+ * (only if blocks has children)
+ * (child block)
+ *
+ *
+ * (child block 2)
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+export function prosemirrorSliceToSlicedBlocks<
+ BSchema extends BlockSchema,
+ I extends InlineContentSchema,
+ S extends StyleSchema
+>(
+ slice: Slice,
+ schema: Schema,
+ blockSchema: BSchema = getBlockSchema(schema) as BSchema,
+ inlineContentSchema: I = getInlineContentSchema(schema) as I,
+ styleSchema: S = getStyleSchema(schema) as S,
+ blockCache: WeakMap> = getBlockCache(schema)
+): {
+ blocks: Block[];
+ blockCutAtStart: string | undefined;
+ blockCutAtEnd: string | undefined;
+} {
+ // console.log(JSON.stringify(slice.toJSON()));
+ function processNode(
+ node: Node,
+ openStart: number,
+ openEnd: number
+ ): {
+ blocks: Block[];
+ blockCutAtStart: string | undefined;
+ blockCutAtEnd: string | undefined;
+ } {
+ if (node.type.name !== "blockGroup") {
+ throw new Error("unexpected");
+ }
+ const blocks: Block[] = [];
+ let blockCutAtStart: string | undefined;
+ let blockCutAtEnd: string | undefined;
+
+ node.forEach((blockContainer, _offset, index) => {
+ if (blockContainer.type.name !== "blockContainer") {
+ throw new Error("unexpected");
+ }
+ if (blockContainer.childCount === 0) {
+ return;
+ }
+ if (blockContainer.childCount === 0 || blockContainer.childCount > 2) {
+ throw new Error(
+ "unexpected, blockContainer.childCount: " + blockContainer.childCount
+ );
+ }
+
+ const isFirstBlock = index === 0;
+ const isLastBlock = index === node.childCount - 1;
+
+ if (blockContainer.firstChild!.type.name === "blockGroup") {
+ // this is the parent where a selection starts within one of its children,
+ // e.g.:
+ // A
+ // ├── B
+ // selection starts within B, then this blockContainer is A, but we don't care about A
+ // so let's descend into B and continue processing
+ if (!isFirstBlock) {
+ throw new Error("unexpected");
+ }
+ const ret = processNode(
+ blockContainer.firstChild!,
+ Math.max(0, openStart - 1),
+ isLastBlock ? Math.max(0, openEnd - 1) : 0
+ );
+ blockCutAtStart = ret.blockCutAtStart;
+ if (isLastBlock) {
+ blockCutAtEnd = ret.blockCutAtEnd;
+ }
+ blocks.push(...ret.blocks);
+ return;
+ }
+
+ const block = nodeToBlock(
+ blockContainer,
+ schema,
+ blockSchema,
+ inlineContentSchema,
+ styleSchema,
+ blockCache
+ );
+ const childGroup =
+ blockContainer.childCount > 1 ? blockContainer.child(1) : undefined;
+
+ let childBlocks: Block[] = [];
+ if (childGroup) {
+ const ret = processNode(
+ childGroup,
+ 0, // TODO: can this be anything other than 0?
+ isLastBlock ? Math.max(0, openEnd - 1) : 0
+ );
+ childBlocks = ret.blocks;
+ if (isLastBlock) {
+ blockCutAtEnd = ret.blockCutAtEnd;
+ }
+ }
+
+ if (isLastBlock && !childGroup && openEnd > 1) {
+ blockCutAtEnd = block.id;
+ }
+
+ if (isFirstBlock && openStart > 1) {
+ blockCutAtStart = block.id;
+ }
+
+ blocks.push({
+ ...(block as any),
+ children: childBlocks,
+ });
+ });
+
+ return { blocks, blockCutAtStart, blockCutAtEnd };
+ }
+
+ if (slice.content.childCount === 0) {
+ return {
+ blocks: [],
+ blockCutAtStart: undefined,
+ blockCutAtEnd: undefined,
+ };
+ }
+
+ if (slice.content.childCount !== 1) {
+ throw new Error(
+ "slice must be a single block, did you forget includeParents=true?"
+ );
+ }
+
+ return processNode(
+ slice.content.firstChild!,
+ Math.max(slice.openStart - 1, 0),
+ Math.max(slice.openEnd - 1, 0)
+ );
+}
diff --git a/packages/core/src/api/nodeConversions/selectionMarkers.test.ts b/packages/core/src/api/nodeConversions/selectionMarkers.test.ts
new file mode 100644
index 0000000000..befc98c4c0
--- /dev/null
+++ b/packages/core/src/api/nodeConversions/selectionMarkers.test.ts
@@ -0,0 +1,359 @@
+import { Node } from "prosemirror-model";
+import { Selection, TextSelection } from "prosemirror-state";
+import { afterAll, beforeAll, describe, expect, it } from "vitest";
+import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
+
+import { PartialBlock } from "../../blocks/defaultBlocks.js";
+
+// These tests are meant to test the copying of user selections in the editor.
+// The test cases used for the other HTML conversion tests are not suitable here
+// as they are represented in the BlockNote API, whereas here we want to test
+// ProseMirror/TipTap selections directly.
+describe("Test ProseMirror selection HTML conversion", () => {
+ const initialContent: PartialBlock[] = [
+ {
+ type: "heading",
+ props: {
+ level: 2,
+ textColor: "red",
+ },
+ content: "Heading 1",
+ children: [
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 1",
+ },
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 2",
+ },
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 3",
+ },
+ ],
+ },
+ {
+ type: "heading",
+ props: {
+ level: 2,
+ textColor: "red",
+ },
+ content: "Heading 2",
+ children: [
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 1",
+ },
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 2",
+ },
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 3",
+ },
+ ],
+ },
+ {
+ type: "heading",
+ props: {
+ level: 2,
+ textColor: "red",
+ },
+ content: [
+ {
+ type: "text",
+ text: "Bold",
+ styles: {
+ bold: true,
+ },
+ },
+ {
+ type: "text",
+ text: "Italic",
+ styles: {
+ italic: true,
+ },
+ },
+ {
+ type: "text",
+ text: "Regular",
+ styles: {},
+ },
+ ],
+ children: [
+ {
+ type: "image",
+ props: {
+ url: "https://ralfvanveen.com/wp-content/uploads/2021/06/Placeholder-_-Glossary.svg",
+ },
+ children: [
+ {
+ type: "paragraph",
+ content: "Nested Paragraph",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "table",
+ content: {
+ type: "tableContent",
+ rows: [
+ {
+ cells: ["Table Cell", "Table Cell"],
+ },
+ {
+ cells: ["Table Cell", "Table Cell"],
+ },
+ ],
+ },
+ // Not needed as selections starting in table cells will get snapped to
+ // the table boundaries.
+ // children: [
+ // {
+ // type: "table",
+ // content: {
+ // type: "tableContent",
+ // rows: [
+ // {
+ // cells: ["Table Cell", "Table Cell"],
+ // },
+ // {
+ // cells: ["Table Cell", "Table Cell"],
+ // },
+ // ],
+ // },
+ // },
+ // ],
+ },
+ ];
+
+ let editor: BlockNoteEditor;
+
+ const div = document.createElement("div");
+
+ beforeAll(async () => {
+ (window as any).__TEST_OPTIONS = (window as any).__TEST_OPTIONS || {};
+ editor = BlockNoteEditor.create({ initialContent });
+ editor.mount(div);
+ });
+
+ afterAll(() => {
+ editor.mount(undefined);
+ editor._tiptapEditor.destroy();
+ editor = undefined as any;
+
+ delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
+ });
+
+ // Sets the editor selection to the given start and end positions, then
+ // exports the selected content to HTML and compares it to a snapshot.
+ async function testSelection(
+ testName: string,
+ startPos: number,
+ endPos: number,
+ ) {
+ editor.transact((tr) =>
+ tr.setSelection(
+ TextSelection.create(editor._tiptapEditor.state.doc, startPos, endPos),
+ ),
+ );
+
+ // const slice = editor._tiptapEditor.state.selection.content();
+
+ const blockNoteSelection = editor.getSelectedBlocksWithSelectionMarkers();
+
+ await expect(
+ JSON.stringify(blockNoteSelection, undefined, 2),
+ ).toMatchFileSnapshot(
+ `./__snapshots_selection_markers_json__/${testName}.json`,
+ );
+ }
+
+ const testCases: { testName: string; startPos: number; endPos: number }[] = [
+ // Selection spans all of first heading's children.
+ {
+ testName: "multipleChildren",
+ startPos: 16,
+ endPos: 78,
+ },
+ // Selection spans from start of first heading to end of its first child.
+ {
+ testName: "childToParent",
+ startPos: 3,
+ endPos: 34,
+ },
+ // Selection spans from middle of first heading to the middle of its first
+ // child.
+ {
+ testName: "partialChildToParent",
+ startPos: 6,
+ endPos: 23,
+ },
+ // Selection spans from start of first heading's first child to end of
+ // second heading's content (does not include second heading's children).
+ {
+ testName: "childrenToNextParent",
+ startPos: 16,
+ endPos: 93,
+ },
+ // Selection spans from start of first heading's first child to end of
+ // second heading's last child.
+ {
+ testName: "childrenToNextParentsChildren",
+ startPos: 16,
+ endPos: 159,
+ },
+ // Selection spans "Regular" text inside third heading.
+ {
+ testName: "unstyledText",
+ startPos: 175,
+ endPos: 182,
+ },
+ // Selection spans "Italic" text inside third heading.
+ {
+ testName: "styledText",
+ startPos: 169,
+ endPos: 175,
+ },
+ // Selection spans third heading's content (does not include third heading's
+ // children).
+ {
+ testName: "multipleStyledText",
+ startPos: 165,
+ endPos: 182,
+ },
+ // Selection spans the image block content.
+ {
+ testName: "image",
+ startPos: 185,
+ endPos: 186,
+ },
+ // Selection spans from start of third heading to end of it's last
+ // descendant.
+ {
+ testName: "nestedImage",
+ startPos: 165,
+ endPos: 205,
+ },
+ // Selection spans text in first cell of the table.
+ {
+ testName: "tableCellText",
+ startPos: 216,
+ endPos: 226,
+ },
+ // Selection spans first cell of the table.
+ {
+ testName: "tableCell",
+ startPos: 215,
+ endPos: 227,
+ },
+ // Selection spans first row of the table.
+ {
+ testName: "tableRow",
+ startPos: 229,
+ endPos: 241,
+ },
+ // Selection spans all cells of the table.
+ {
+ testName: "tableAllCells",
+ startPos: 259,
+ endPos: 271,
+ },
+ ];
+ // const testCase = testCases.find((testCase) => testCase.testName === "image");
+ // it.only(testCase.testName, () => {
+ // testSelection(testCase.testName, testCase.startPos, testCase.endPos);
+ // });
+
+ for (const testCase of testCases) {
+ // (TODO?)
+ // eslint-disable-next-line jest/valid-title
+ it(testCase.testName, async () => {
+ await testSelection(
+ testCase.testName,
+ testCase.startPos,
+ testCase.endPos,
+ );
+ });
+ }
+
+ it("move end", async () => {
+ let ret = "";
+
+ loopTextSelections(editor._tiptapEditor.state.doc, "end", (selection) => {
+ if (selection.empty) {
+ return;
+ }
+ editor.transact((tr) => tr.setSelection(selection));
+
+ const blockNoteSelection = editor.getSelectedBlocksWithSelectionMarkers();
+ const JSONString = JSON.stringify(blockNoteSelection);
+ ret += JSONString + "\n";
+ });
+
+ await expect(ret).toMatchFileSnapshot(
+ `./__snapshots_selection_markers_json__/move_end.txt`,
+ );
+ });
+
+ it("move start", async () => {
+ let ret = "";
+
+ loopTextSelections(editor._tiptapEditor.state.doc, "start", (selection) => {
+ if (selection.empty) {
+ return;
+ }
+ editor.transact((tr) => tr.setSelection(selection));
+
+ const blockNoteSelection = editor.getSelectedBlocksWithSelectionMarkers();
+ const JSONString = JSON.stringify(blockNoteSelection);
+ ret += JSONString + "\n";
+ });
+
+ await expect(ret).toMatchFileSnapshot(
+ `./__snapshots_selection_markers_json__/move_start.txt`,
+ );
+ });
+});
+
+function loopTextSelections(
+ doc: Node,
+ move: "start" | "end",
+ cb: (selection: Selection) => void,
+) {
+ const size = doc.content.size;
+
+ for (let i = 0; i < size; i++) {
+ const selection = TextSelection.between(
+ move === "start" ? doc.resolve(i) : doc.resolve(0),
+ move === "start" ? doc.resolve(size - 1) : doc.resolve(i),
+ );
+ if (
+ (move === "start" && selection.from !== i) ||
+ (move === "end" && selection.to !== i)
+ ) {
+ // The TextSelection.between has moved the position to a valid text position.
+ // In this case we just skip it.
+ // (we either have seen this text selection already or it's coming up as we iterate further)
+ continue;
+ }
+ cb(selection);
+ }
+}
+/**
+ *
+ * Insert $#$ markers around the selection
+ *
+ * respond with regular update / remove add blocks
+ *
+ * just apply updates
+ * (possibly: check if updates only affect selection)
+ *
+ *
+ * post partial "slice" blocks that are selected
+ * respond with similar slice
+ */
diff --git a/packages/core/src/api/nodeConversions/selections.test.ts b/packages/core/src/api/nodeConversions/selections.test.ts
new file mode 100644
index 0000000000..a1d6713ff6
--- /dev/null
+++ b/packages/core/src/api/nodeConversions/selections.test.ts
@@ -0,0 +1,332 @@
+import { TextSelection } from "prosemirror-state";
+import { afterAll, beforeAll, describe, expect, it } from "vitest";
+import { PartialBlock } from "../../blocks/defaultBlocks.js";
+import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
+
+// These tests are meant to test the copying of user selections in the editor.
+// The test cases used for the other HTML conversion tests are not suitable here
+// as they are represented in the BlockNote API, whereas here we want to test
+// ProseMirror/TipTap selections directly.
+describe("Test ProseMirror selection HTML conversion", () => {
+ const initialContent: PartialBlock[] = [
+ {
+ type: "heading",
+ props: {
+ level: 2,
+ textColor: "red",
+ },
+ content: "Heading 1",
+ children: [
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 1",
+ },
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 2",
+ },
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 3",
+ },
+ ],
+ },
+ {
+ type: "heading",
+ props: {
+ level: 2,
+ textColor: "red",
+ },
+ content: "Heading 2",
+ children: [
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 1",
+ },
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 2",
+ },
+ {
+ type: "paragraph",
+ content: "Nested Paragraph 3",
+ },
+ ],
+ },
+ {
+ type: "heading",
+ props: {
+ level: 2,
+ textColor: "red",
+ },
+ content: [
+ {
+ type: "text",
+ text: "Bold",
+ styles: {
+ bold: true,
+ },
+ },
+ {
+ type: "text",
+ text: "Italic",
+ styles: {
+ italic: true,
+ },
+ },
+ {
+ type: "text",
+ text: "Regular",
+ styles: {},
+ },
+ ],
+ children: [
+ {
+ type: "image",
+ props: {
+ url: "https://ralfvanveen.com/wp-content/uploads/2021/06/Placeholder-_-Glossary.svg",
+ },
+ children: [
+ {
+ type: "paragraph",
+ content: "Nested Paragraph",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ type: "table",
+ content: {
+ type: "tableContent",
+ rows: [
+ {
+ cells: ["Table Cell", "Table Cell"],
+ },
+ {
+ cells: ["Table Cell", "Table Cell"],
+ },
+ ],
+ },
+ // Not needed as selections starting in table cells will get snapped to
+ // the table boundaries.
+ // children: [
+ // {
+ // type: "table",
+ // content: {
+ // type: "tableContent",
+ // rows: [
+ // {
+ // cells: ["Table Cell", "Table Cell"],
+ // },
+ // {
+ // cells: ["Table Cell", "Table Cell"],
+ // },
+ // ],
+ // },
+ // },
+ // ],
+ },
+ ];
+
+ let editor: BlockNoteEditor;
+
+ const div = document.createElement("div");
+
+ beforeAll(async () => {
+ (window as any).__TEST_OPTIONS = (window as any).__TEST_OPTIONS || {};
+ editor = BlockNoteEditor.create({ initialContent });
+ editor.mount(div);
+ });
+
+ afterAll(() => {
+ editor.mount(undefined);
+ editor._tiptapEditor.destroy();
+ editor = undefined as any;
+
+ delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
+ });
+
+ // Sets the editor selection to the given start and end positions, then
+ // exports the selected content to HTML and compares it to a snapshot.
+ async function testSelection(
+ testName: string,
+ startPos: number,
+ endPos: number,
+ ) {
+ editor.transact((tr) =>
+ tr.setSelection(
+ TextSelection.create(editor._tiptapEditor.state.doc, startPos, endPos),
+ ),
+ );
+
+ // const slice = editor._tiptapEditor.state.selection.content();
+
+ const blockNoteSelection = editor.getSelection2();
+
+ await expect(
+ JSON.stringify(blockNoteSelection, undefined, 2),
+ ).toMatchFileSnapshot(`./__snapshots_selection_json__/${testName}.json`);
+ }
+
+ const testCases: { testName: string; startPos: number; endPos: number }[] = [
+ // Selection spans all of first heading's children.
+ {
+ testName: "multipleChildren",
+ startPos: 16,
+ endPos: 78,
+ },
+ // Selection spans from start of first heading to end of its first child.
+ {
+ testName: "childToParent",
+ startPos: 3,
+ endPos: 34,
+ },
+ // Selection spans from middle of first heading to the middle of its first
+ // child.
+ {
+ testName: "partialChildToParent",
+ startPos: 6,
+ endPos: 23,
+ },
+ // Selection spans from start of first heading's first child to end of
+ // second heading's content (does not include second heading's children).
+ {
+ testName: "childrenToNextParent",
+ startPos: 16,
+ endPos: 93,
+ },
+ // Selection spans from start of first heading's first child to end of
+ // second heading's last child.
+ {
+ testName: "childrenToNextParentsChildren",
+ startPos: 16,
+ endPos: 159,
+ },
+ // Selection spans "Regular" text inside third heading.
+ {
+ testName: "unstyledText",
+ startPos: 175,
+ endPos: 182,
+ },
+ // Selection spans "Italic" text inside third heading.
+ {
+ testName: "styledText",
+ startPos: 169,
+ endPos: 175,
+ },
+ // Selection spans third heading's content (does not include third heading's
+ // children).
+ {
+ testName: "multipleStyledText",
+ startPos: 165,
+ endPos: 182,
+ },
+ // Selection spans the image block content.
+ {
+ testName: "image",
+ startPos: 185,
+ endPos: 186,
+ },
+ // Selection spans from start of third heading to end of it's last
+ // descendant.
+ {
+ testName: "nestedImage",
+ startPos: 165,
+ endPos: 205,
+ },
+ // Selection spans text in first cell of the table.
+ {
+ testName: "tableCellText",
+ startPos: 216,
+ endPos: 226,
+ },
+ // Selection spans first cell of the table.
+ {
+ testName: "tableCell",
+ startPos: 215,
+ endPos: 227,
+ },
+ // Selection spans first row of the table.
+ {
+ testName: "tableRow",
+ startPos: 229,
+ endPos: 241,
+ },
+ // Selection spans all cells of the table.
+ {
+ testName: "tableAllCells",
+ startPos: 259,
+ endPos: 271,
+ },
+ ];
+
+ for (const testCase of testCases) {
+ // (TODO?)
+ // eslint-disable-next-line jest/valid-title
+ it(testCase.testName, async () => {
+ await testSelection(
+ testCase.testName,
+ testCase.startPos,
+ testCase.endPos,
+ );
+ });
+ }
+
+ it("move end", async () => {
+ const size = editor._tiptapEditor.state.doc.content.size;
+
+ let ret = "";
+
+ for (let i = 0; i < size; i++) {
+ editor.transact((tr) =>
+ tr.setSelection(
+ TextSelection.create(editor._tiptapEditor.state.doc, 0, i),
+ ),
+ );
+ const blockNoteSelection = editor.getSelection2();
+ const JSONString = JSON.stringify(blockNoteSelection);
+ ret += JSONString + "\n";
+ }
+
+ await expect(ret).toMatchFileSnapshot(
+ `./__snapshots_selection_json__/move_end.txt`,
+ );
+ });
+
+ it("move start", async () => {
+ const size = editor._tiptapEditor.state.doc.content.size;
+
+ let ret = "";
+
+ for (let i = 0; i < size; i++) {
+ editor.transact((tr) =>
+ tr.setSelection(
+ TextSelection.create(editor._tiptapEditor.state.doc, i, size - 1),
+ ),
+ );
+
+ const blockNoteSelection = editor.getSelection2();
+ const JSONString = JSON.stringify(blockNoteSelection);
+ ret += JSONString + "\n";
+ }
+
+ await expect(ret).toMatchFileSnapshot(
+ `./__snapshots_selection_json__/move_start.txt`,
+ );
+ });
+});
+
+/**
+ *
+ * Insert $#$ markers around the selection
+ *
+ * respond with regular update / remove add blocks
+ *
+ * just apply updates
+ * (possibly: check if updates only affect selection)
+ *
+ *
+ * post partial "slice" blocks that are selected
+ * respond with similar slice
+ */
diff --git a/packages/core/src/api/pmUtil.ts b/packages/core/src/api/pmUtil.ts
index 95fa59fca3..acda05b3a8 100644
--- a/packages/core/src/api/pmUtil.ts
+++ b/packages/core/src/api/pmUtil.ts
@@ -1,12 +1,12 @@
import type { Node, Schema } from "prosemirror-model";
-import type { Transaction } from "prosemirror-state";
+import { Transform } from "prosemirror-transform";
import type { BlockNoteEditor } from "../editor/BlockNoteEditor.js";
+import { BlockNoteSchema } from "../editor/BlockNoteSchema.js";
import type { BlockSchema } from "../schema/blocks/types.js";
import type { InlineContentSchema } from "../schema/inlineContent/types.js";
import type { StyleSchema } from "../schema/styles/types.js";
-import { BlockNoteSchema } from "../editor/BlockNoteSchema.js";
-export function getPmSchema(trOrNode: Transaction | Node) {
+export function getPmSchema(trOrNode: Transform | Node) {
if ("doc" in trOrNode) {
return trOrNode.doc.type.schema;
}
diff --git a/packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts b/packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts
index 4733fc88d5..690bd31ede 100644
--- a/packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts
+++ b/packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts
@@ -1,15 +1,15 @@
+import type { HighlighterGeneric } from "@shikijs/types";
import { InputRule, isTextSelection } from "@tiptap/core";
import { TextSelection } from "@tiptap/pm/state";
-import { createHighlightPlugin, Parser } from "prosemirror-highlight";
+import { Parser, createHighlightPlugin } from "prosemirror-highlight";
import { createParser } from "prosemirror-highlight/shiki";
+import { BlockNoteEditor } from "../../index.js";
import {
+ PropSchema,
createBlockSpecFromStronglyTypedTiptapNode,
createStronglyTypedTiptapNode,
- PropSchema,
} from "../../schema/index.js";
import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers.js";
-import type { HighlighterGeneric } from "@shikijs/types";
-import { BlockNoteEditor } from "../../index.js";
export type CodeBlockOptions = {
/**
@@ -150,7 +150,7 @@ const CodeBlockContent = createStronglyTypedTiptapNode({
},
{
tag: "pre",
- contentElement: "code",
+ // contentElement: "code",
preserveWhitespace: "full",
},
];
diff --git a/packages/core/src/blocks/TableBlockContent/TableBlockContent.ts b/packages/core/src/blocks/TableBlockContent/TableBlockContent.ts
index 1375a528f3..5c4aa40305 100644
--- a/packages/core/src/blocks/TableBlockContent/TableBlockContent.ts
+++ b/packages/core/src/blocks/TableBlockContent/TableBlockContent.ts
@@ -1,9 +1,10 @@
import { TableCell } from "@tiptap/extension-table-cell";
import { TableHeader } from "@tiptap/extension-table-header";
-import { TableRow } from "@tiptap/extension-table-row";
+
import { Node as PMNode } from "prosemirror-model";
import { TableView } from "prosemirror-tables";
+import { Node, mergeAttributes } from "@tiptap/core";
import { NodeView } from "prosemirror-view";
import {
createBlockSpecFromStronglyTypedTiptapNode,
@@ -24,6 +25,7 @@ export const TableBlockContent = createStronglyTypedTiptapNode({
group: "blockContent",
tableRole: "table",
+ marks: "deletion",
isolating: true,
parseHTML() {
@@ -152,6 +154,36 @@ const TableParagraph = createStronglyTypedTiptapNode({
},
});
+/**
+ * This extension allows you to create table rows.
+ * @see https://www.tiptap.dev/api/nodes/table-row
+ */
+export const TableRow = Node.create<{ HTMLAttributes: Record }>({
+ name: "tableRow",
+
+ addOptions() {
+ return {
+ HTMLAttributes: {},
+ };
+ },
+
+ content: "(tableCell | tableHeader)+",
+
+ tableRole: "row",
+ marks: "deletion",
+ parseHTML() {
+ return [{ tag: "tr" }];
+ },
+
+ renderHTML({ HTMLAttributes }) {
+ return [
+ "tr",
+ mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
+ 0,
+ ];
+ },
+});
+
export const Table = createBlockSpecFromStronglyTypedTiptapNode(
TableBlockContent,
tablePropSchema,
diff --git a/packages/core/src/blocks/defaultBlockTypeGuards.ts b/packages/core/src/blocks/defaultBlockTypeGuards.ts
index 1704456045..d4d0c47e36 100644
--- a/packages/core/src/blocks/defaultBlockTypeGuards.ts
+++ b/packages/core/src/blocks/defaultBlockTypeGuards.ts
@@ -1,6 +1,7 @@
import { CellSelection } from "prosemirror-tables";
import type { BlockNoteEditor } from "../editor/BlockNoteEditor.js";
import {
+ BlockConfig,
BlockFromConfig,
BlockSchema,
FileBlockConfig,
@@ -17,6 +18,22 @@ import {
import { defaultProps } from "./defaultProps.js";
import { Selection } from "prosemirror-state";
+// TODO: check
+export function checkBlockTypeInSchema<
+ Config extends BlockConfig,
+ I extends InlineContentSchema,
+ S extends StyleSchema
+>(
+ blockConfig: Config,
+ editor: BlockNoteEditor
+): editor is BlockNoteEditor<{ Type: Config }, I, S> {
+ return (
+ blockConfig.type in editor.schema.blockSchema &&
+ editor.schema.blockSchema[blockConfig.type] === blockConfig
+ );
+}
+
+// TODO: can we reuse checkBlockTypeInSchema?
export function checkDefaultBlockTypeInSchema<
BlockType extends keyof DefaultBlockSchema,
I extends InlineContentSchema,
diff --git a/packages/core/src/editor/Block.css b/packages/core/src/editor/Block.css
index b86e8e1af3..6116599fcd 100644
--- a/packages/core/src/editor/Block.css
+++ b/packages/core/src/editor/Block.css
@@ -433,7 +433,6 @@ NESTED BLOCKS
position: absolute;
font-style: italic;
}
-
/* TODO: should this be here? */
/* TEXT COLORS */
diff --git a/packages/core/src/editor/BlockNoteEditor.test.ts b/packages/core/src/editor/BlockNoteEditor.test.ts
index d77787a93c..c2f753c5f0 100644
--- a/packages/core/src/editor/BlockNoteEditor.test.ts
+++ b/packages/core/src/editor/BlockNoteEditor.test.ts
@@ -75,6 +75,13 @@ it("adds id attribute when requested", async () => {
);
});
+it("updates block", () => {
+ const editor = BlockNoteEditor.create();
+ editor.updateBlock(editor.document[0], {
+ content: "hello",
+ });
+});
+
it("block prop types", () => {
// this test checks whether the block props are correctly typed in typescript
const editor = BlockNoteEditor.create();
diff --git a/packages/core/src/editor/BlockNoteEditor.ts b/packages/core/src/editor/BlockNoteEditor.ts
index f3d4c108b0..0bc6d18b79 100644
--- a/packages/core/src/editor/BlockNoteEditor.ts
+++ b/packages/core/src/editor/BlockNoteEditor.ts
@@ -93,6 +93,7 @@ import {
import { Dictionary } from "../i18n/dictionary.js";
import { en } from "../i18n/locales/index.js";
+import { redo, undo } from "@tiptap/pm/history";
import {
TextSelection,
type Command,
@@ -101,11 +102,15 @@ import {
} from "@tiptap/pm/state";
import { dropCursor } from "prosemirror-dropcursor";
import { EditorView } from "prosemirror-view";
-import { undoCommand, redoCommand, ySyncPluginKey } from "y-prosemirror";
-import { undo, redo } from "@tiptap/pm/history";
+import { redoCommand, undoCommand, ySyncPluginKey } from "y-prosemirror";
import { createInternalHTMLSerializer } from "../api/exporters/html/internalHTMLSerializer.js";
import { inlineContentToNodes } from "../api/nodeConversions/blockToNode.js";
-import { nodeToBlock } from "../api/nodeConversions/nodeToBlock.js";
+import {
+ docToBlocks,
+ getDocumentWithSelectionMarkers,
+ getSelectedBlocksWithSelectionMarkers,
+ prosemirrorSliceToSlicedBlocks,
+} from "../api/nodeConversions/nodeToBlock.js";
import {
BlocksChanged,
getBlocksChangedByTransaction,
@@ -113,20 +118,31 @@ import {
import { nestedListsToBlockNoteStructure } from "../api/parsers/html/util/nestedLists.js";
import { CodeBlockOptions } from "../blocks/CodeBlockContent/CodeBlockContent.js";
import type { ThreadStore, User } from "../comments/index.js";
+import { CursorPlugin } from "../extensions/Collaboration/CursorPlugin.js";
import "../style.css";
import { EventEmitter } from "../util/EventEmitter.js";
-import { CursorPlugin } from "../extensions/Collaboration/CursorPlugin.js";
+import { BlockNoteExtension } from "./BlockNoteExtension.js";
+/**
+ * A factory function that returns a BlockNoteExtension
+ * This is useful so we can create extensions that require an editor instance
+ * in the constructor
+ */
export type BlockNoteExtensionFactory = (
editor: BlockNoteEditor,
) => BlockNoteExtension;
-export type BlockNoteExtension =
+/**
+ * We support Tiptap extensions and BlockNoteExtension based extensions
+ */
+export type SupportedExtension =
| AnyExtension
| {
- plugin: Plugin;
+ plugin: Plugin; // TODO: deprecate this format and use BlockNoteExtension instead
+ plugins?: Plugin[];
priority?: number;
- };
+ }
+ | BlockNoteExtension;
export type BlockCache<
BSchema extends BlockSchema = any,
@@ -404,7 +420,7 @@ export class BlockNoteEditor<
/**
* extensions that are added to the editor, can be tiptap extensions or prosemirror plugins
*/
- public readonly extensions: Record = {};
+ public readonly extensions: Record = {};
/**
* Boolean indicating whether the editor is in headless mode.
@@ -691,7 +707,16 @@ export class BlockNoteEditor<
return ext;
}
- if (!ext.plugin) {
+ if (ext instanceof BlockNoteExtension && !ext.plugin && !ext.plugins) {
+ return undefined;
+ }
+
+ const plugins = [
+ ...(ext.plugin ? [ext.plugin] : []),
+ ...(ext.plugins || []),
+ ];
+
+ if (!plugins.length) {
throw new Error(
"Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property",
);
@@ -701,10 +726,11 @@ export class BlockNoteEditor<
return Extension.create({
name: key,
priority: ext.priority,
- addProseMirrorPlugins: () => [ext.plugin],
+ addProseMirrorPlugins: () => plugins,
});
}),
- ];
+ ].filter((ext): ext is Extension => ext !== undefined);
+
const tiptapOptions: BlockNoteTipTapEditorOptions = {
...blockNoteTipTapOptions,
...newOptions._tiptapOptions,
@@ -865,6 +891,26 @@ export class BlockNoteEditor<
}
}
+ // TO DISCUSS
+ /**
+ * Shorthand to get a typed extension from the editor, by
+ * just passing in the extension class.
+ *
+ * @param ext - The extension class to get
+ * @param key - optional, the key of the extension in the extensions object (defaults to the extension name)
+ * @returns The extension instance
+ */
+ public extension(
+ ext: { new (...args: any[]): T } & typeof BlockNoteExtension,
+ key = ext.name()
+ ): T {
+ const extension = this.extensions[key] as T;
+ if (!extension) {
+ throw new Error(`Extension ${key} not found`);
+ }
+ return extension;
+ }
+
/**
* Mount the editor to a parent DOM element. Call mount(undefined) to clean up
*
@@ -946,15 +992,10 @@ export class BlockNoteEditor<
*/
public get document(): Block[] {
return this.transact((tr) => {
- const blocks: Block[] = [];
-
- tr.doc.firstChild!.descendants((node) => {
- blocks.push(nodeToBlock(node, this.pmSchema));
-
- return false;
- });
-
- return blocks;
+ return docToBlocks(
+ tr.doc,
+ this.pmSchema
+ );
});
}
@@ -1098,6 +1139,138 @@ export class BlockNoteEditor<
);
}
+ public getDocumentWithSelectionMarkers() {
+ return getDocumentWithSelectionMarkers(
+ this.prosemirrorState,
+ this.prosemirrorState.selection.from,
+ this.prosemirrorState.selection.to,
+ this.pmSchema,
+ );
+ }
+
+ // TODO: what about node selections?
+ public getSelectedBlocksWithSelectionMarkers() {
+ const start = this.prosemirrorState.selection.$from;
+ const end = this.prosemirrorState.selection.$to;
+
+ return getSelectedBlocksWithSelectionMarkers(
+ this.prosemirrorState,
+ start.pos,
+ end.pos,
+ this.pmSchema
+ );
+ }
+
+ // TODO
+ // public updateSelection(blocks: Block[]) {
+ // let start = this.prosemirrorState.selection.$from;
+ // let end = this.prosemirrorState.selection.$to;
+
+ // // the selection moves below are used to make sure `prosemirrorSliceToSlicedBlocks` returns
+ // // the correct information about whether content is cut at the start or end of a block
+ // // TODO: might make more sense to move the logic there
+
+ // // if the end is at the end of a node (|) move it forward so we include all closing tags (|)
+ // while (end.parentOffset >= end.parent.nodeSize - 2 && end.depth > 0) {
+ // end = this.prosemirrorState.doc.resolve(end.pos + 1);
+ // }
+
+ // // if the end is at the start of an empty node (
|) move it backwards so we drop empty start tags (
|)
+ // while (end.parentOffset === 0 && end.depth > 0) {
+ // end = this.prosemirrorState.doc.resolve(end.pos - 1);
+ // }
+
+ // // if the start is at the start of a node (
|) move it backwards so we include all open tags (|
)
+ // while (start.parentOffset === 0 && start.depth > 0) {
+ // start = this.prosemirrorState.doc.resolve(start.pos - 1);
+ // }
+
+ // // if the start is at the end of a node (|
|) move it forwards so we drop all closing tags (|
)
+ // while (start.parentOffset >= start.parent.nodeSize - 2 && start.depth > 0) {
+ // start = this.prosemirrorState.doc.resolve(start.pos + 1);
+ // }
+
+ // // const node = blockto(blocks, this.schema.blockSchema, this.schema.inlineContentSchema, this.schema.styleSchema);
+ // // this.prosemirrorState.tr.replaceWith(start.pos, end.pos, blocks);
+ // // this.prosemirrorState.doc.slice(start.pos, end.pos, true),
+ // // this.schema.blockSchema,
+ // // this.schema.inlineContentSchema,
+ // // this.schema.styleSchema,
+ // // this.blockCache
+ // // );
+ // }
+
+ // TODO: fix image node selection
+ public getSelection2() {
+ let start = this.prosemirrorState.selection.$from;
+ let end = this.prosemirrorState.selection.$to;
+
+ // the selection moves below are used to make sure `prosemirrorSliceToSlicedBlocks` returns
+ // the correct information about whether content is cut at the start or end of a block
+ // TODO: might make more sense to move the logic there
+
+ // if the end is at the end of a node (|
) move it forward so we include all closing tags (
|)
+ while (end.parentOffset >= end.parent.nodeSize - 2 && end.depth > 0) {
+ end = this.prosemirrorState.doc.resolve(end.pos + 1);
+ }
+
+ // if the end is at the start of an empty node (
|) move it backwards so we drop empty start tags (
|)
+ while (end.parentOffset === 0 && end.depth > 0) {
+ end = this.prosemirrorState.doc.resolve(end.pos - 1);
+ }
+
+ // if the start is at the start of a node (
|) move it backwards so we include all open tags (|
)
+ while (start.parentOffset === 0 && start.depth > 0) {
+ start = this.prosemirrorState.doc.resolve(start.pos - 1);
+ }
+
+ // if the start is at the end of a node (|
|) move it forwards so we drop all closing tags (|
)
+ while (start.parentOffset >= start.parent.nodeSize - 2 && start.depth > 0) {
+ start = this.prosemirrorState.doc.resolve(start.pos + 1);
+ }
+
+ const selectionInfo = prosemirrorSliceToSlicedBlocks(
+ this.prosemirrorState.doc.slice(start.pos, end.pos, true),
+ this.pmSchema
+ );
+
+ return {
+ _meta: {
+ startPos: start.pos,
+ endPos: end.pos,
+ },
+ ...selectionInfo,
+ // // TODO: just make a updateSelectedBlock() method or sth
+ // updateBlock: (
+ // blockToUpdate: BlockIdentifier,
+ // block: PartialBlock
+ // ) => {
+ // // TODO: pass through position mapper
+ // let replaceFromPos: number | undefined;
+ // let replaceToPos: number | undefined;
+
+ // if (selectionInfo.blockCutAtStart === selectionInfo.blocks[0].id) {
+ // replaceFromPos = start.pos;
+ // }
+
+ // if (
+ // selectionInfo.blockCutAtEnd ===
+ // selectionInfo.blocks[selectionInfo.blocks.length - 1].id
+ // ) {
+ // replaceToPos = end.pos;
+ // }
+
+ // return updateBlock(
+ // this,
+ // blockToUpdate,
+ // block,
+ // replaceFromPos,
+ // replaceToPos
+ // );
+ // },
+ };
+ }
+
/**
* Gets a snapshot of the current selection.
*/
@@ -1114,6 +1287,14 @@ export class BlockNoteEditor<
return this.transact((tr) => setSelection(tr, startBlock, endBlock));
}
+ public clearSelection() {
+ this.transact((tr) =>
+ tr.setSelection(
+ TextSelection.near(this.prosemirrorState.doc.resolve(0))
+ )
+ );
+ }
+
/**
* Checks if the editor is currently editable, or if it's locked.
* @returns True if the editor is editable, false otherwise.
@@ -1589,8 +1770,8 @@ export class BlockNoteEditor<
if (!this.prosemirrorView) {
return undefined;
}
- const state = this.prosemirrorView?.state;
- const { selection } = state;
+
+ const { selection } = this.prosemirrorState;
// support for CellSelections
const { ranges } = selection;
diff --git a/packages/core/src/editor/BlockNoteExtension.ts b/packages/core/src/editor/BlockNoteExtension.ts
new file mode 100644
index 0000000000..837e26f1f6
--- /dev/null
+++ b/packages/core/src/editor/BlockNoteExtension.ts
@@ -0,0 +1,17 @@
+import { Plugin } from "prosemirror-state";
+
+export abstract class BlockNoteExtension {
+ public static name(): string {
+ throw new Error("You must implement the name method in your extension");
+ }
+
+ public plugin?: Plugin;
+ public plugins?: Plugin[];
+ public priority?: number;
+
+ // eslint-disable-next-line
+ constructor(..._args: any[]) {
+ // Allow subclasses to have constructors with parameters
+ // without this, we can't easily implement BlockNoteEditor.extension(MyExtension) pattern
+ }
+}
diff --git a/packages/core/src/editor/BlockNoteExtensions.ts b/packages/core/src/editor/BlockNoteExtensions.ts
index b0c5db73ba..cda757cf5a 100644
--- a/packages/core/src/editor/BlockNoteExtensions.ts
+++ b/packages/core/src/editor/BlockNoteExtensions.ts
@@ -9,13 +9,14 @@ import * as Y from "yjs";
import { createDropFileExtension } from "../api/clipboard/fromClipboard/fileDropExtension.js";
import { createPasteFromClipboardExtension } from "../api/clipboard/fromClipboard/pasteExtension.js";
import { createCopyToClipboardExtension } from "../api/clipboard/toClipboard/copyExtension.js";
+import type { ThreadStore } from "../comments/index.js";
+import { AgentCursorPlugin } from "../extensions/AgentCursor/AgentCursorPlugin.js";
import { BackgroundColorExtension } from "../extensions/BackgroundColor/BackgroundColorExtension.js";
import { CursorPlugin } from "../extensions/Collaboration/CursorPlugin.js";
import { UndoPlugin } from "../extensions/Collaboration/UndoPlugin.js";
import { SyncPlugin } from "../extensions/Collaboration/SyncPlugin.js";
import { CommentMark } from "../extensions/Comments/CommentMark.js";
import { CommentsPlugin } from "../extensions/Comments/CommentsPlugin.js";
-import type { ThreadStore } from "../comments/index.js";
import { FilePanelProsemirrorPlugin } from "../extensions/FilePanel/FilePanelPlugin.js";
import { FormattingToolbarProsemirrorPlugin } from "../extensions/FormattingToolbar/FormattingToolbarPlugin.js";
import { HardBreak } from "../extensions/HardBreak/HardBreak.js";
@@ -31,6 +32,11 @@ import { PreviousBlockTypePlugin } from "../extensions/PreviousBlockType/Previou
import { ShowSelectionPlugin } from "../extensions/ShowSelection/ShowSelectionPlugin.js";
import { SideMenuProsemirrorPlugin } from "../extensions/SideMenu/SideMenuPlugin.js";
import { SuggestionMenuProseMirrorPlugin } from "../extensions/SuggestionMenu/SuggestionPlugin.js";
+import {
+ SuggestionAddMark,
+ SuggestionDeleteMark,
+ SuggestionModificationMark,
+} from "../extensions/Suggestions/SuggestionMarks.js";
import { TableHandlesProsemirrorPlugin } from "../extensions/TableHandles/TableHandlesPlugin.js";
import { TextAlignmentExtension } from "../extensions/TextAlignment/TextAlignmentExtension.js";
import { TextColorExtension } from "../extensions/TextColor/TextColorExtension.js";
@@ -49,7 +55,7 @@ import {
import type {
BlockNoteEditor,
BlockNoteEditorOptions,
- BlockNoteExtension,
+ SupportedExtension,
} from "./BlockNoteEditor.js";
type ExtensionOptions<
@@ -101,7 +107,7 @@ export const getBlockNoteExtensions = <
>(
opts: ExtensionOptions
) => {
- const ret: Record = {};
+ const ret: Record = {};
const tiptapExtensions = getTipTapExtensions(opts);
for (const ext of tiptapExtensions) {
@@ -159,6 +165,8 @@ export const getBlockNoteExtensions = <
);
}
+ ret["agentCursor"] = new AgentCursorPlugin(opts.editor);
+
const disableExtensions: string[] = opts.disableExtensions || [];
for (const ext of disableExtensions) {
delete ret[ext];
@@ -202,6 +210,9 @@ const getTipTapExtensions = <
Text,
// marks:
+ SuggestionAddMark,
+ SuggestionDeleteMark,
+ SuggestionModificationMark,
Link.extend({
inclusive: false,
}).configure({
diff --git a/packages/core/src/editor/BlockNoteTipTapEditor.ts b/packages/core/src/editor/BlockNoteTipTapEditor.ts
index 66ee5055ef..f6458692ea 100644
--- a/packages/core/src/editor/BlockNoteTipTapEditor.ts
+++ b/packages/core/src/editor/BlockNoteTipTapEditor.ts
@@ -1,5 +1,9 @@
-import { Editor, EditorOptions, createDocument } from "@tiptap/core";
-import { Editor as TiptapEditor } from "@tiptap/core";
+import {
+ Editor,
+ EditorOptions,
+ Editor as TiptapEditor,
+ createDocument,
+} from "@tiptap/core";
import { Node } from "@tiptap/pm/model";
@@ -26,7 +30,7 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
public static create = (
options: BlockNoteTipTapEditorOptions,
- styleSchema: StyleSchema
+ styleSchema: StyleSchema,
) => {
// because we separate the constructor from the creation of the view,
// we need to patch setTimeout to prevent this code from having any effect:
@@ -48,7 +52,7 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
protected constructor(
options: BlockNoteTipTapEditorOptions,
- styleSchema: StyleSchema
+ styleSchema: StyleSchema,
) {
// possible fix for next.js server side rendering
// const d = globalThis.document;
@@ -93,7 +97,7 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
try {
const pmNodes = options?.content.map((b) =>
- blockToNode(b, this.schema, styleSchema).toJSON()
+ blockToNode(b, this.schema, styleSchema).toJSON(),
);
doc = createDocument(
{
@@ -106,17 +110,17 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
],
},
this.schema,
- this.options.parseOptions
+ this.options.parseOptions,
);
} catch (e) {
// eslint-disable-next-line no-console
console.error(
"Error creating document from blocks passed as `initialContent`. Caused by exception: ",
- e
+ e,
);
throw new Error(
"Error creating document from blocks passed as `initialContent`:\n" +
- +JSON.stringify(options.content)
+ +JSON.stringify(options.content),
);
}
@@ -141,6 +145,10 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
if (!this.view) {
// before view has been initialized
this._state = this.state.apply(transaction);
+ this.emit("transaction", {
+ editor: this,
+ transaction,
+ });
return;
}
// This is a verbatim copy of the default dispatch method, but with the following changes:
@@ -216,12 +224,25 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
});
}
+ // a helper method that can enable plugins before the view has been initialized
+ // currently only used for testing
+ forceEnablePlugins() {
+ if (this.view) {
+ throw new Error(
+ "forcePluginsEnabled called after view has been initialized",
+ );
+ }
+ this._state = this.state.reconfigure({
+ plugins: this.extensionManager.plugins,
+ });
+ }
+
/**
* Replace the default `createView` method with a custom one - which we call on mount
*/
private createViewAlternative(
blockNoteEditor: BlockNoteEditor,
- contentComponent?: any
+ contentComponent?: any,
) {
(this as any).contentComponent = contentComponent;
@@ -244,7 +265,7 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
state: this.state,
markViews,
nodeViews: this.extensionManager.nodeViews,
- }
+ },
);
// `editor.view` is not yet available at this time.
@@ -263,7 +284,7 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
this.commands.focus(
this.options.autofocus ||
this.options.element.getAttribute("data-bn-autofocus") === "true",
- { scrollIntoView: false }
+ { scrollIntoView: false },
);
this.emit("create", { editor: this });
this.isInitialized = true;
@@ -277,7 +298,7 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
public mount = (
blockNoteEditor: BlockNoteEditor,
element?: HTMLElement | null,
- contentComponent?: any
+ contentComponent?: any,
) => {
if (!element) {
this.destroy();
diff --git a/packages/core/src/extensions/AgentCursor/AgentCursorPlugin.ts b/packages/core/src/extensions/AgentCursor/AgentCursorPlugin.ts
new file mode 100644
index 0000000000..b44825a848
--- /dev/null
+++ b/packages/core/src/extensions/AgentCursor/AgentCursorPlugin.ts
@@ -0,0 +1,105 @@
+import { Plugin, PluginKey } from "prosemirror-state";
+import { Decoration, DecorationSet } from "prosemirror-view";
+import { defaultSelectionBuilder } from "y-prosemirror";
+import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
+
+type AgentCursorState = {
+ selection: { anchor: number; head: number } | undefined;
+};
+const PLUGIN_KEY = new PluginKey(`blocknote-agent-cursor`);
+
+const user = {
+ name: "AI",
+ color: "#8bc6ff",
+};
+
+// TODO: move to xl-ai?
+export class AgentCursorPlugin {
+ public readonly plugin: Plugin;
+ constructor(_editor: BlockNoteEditor) {
+ this.plugin = new Plugin({
+ key: PLUGIN_KEY,
+ view: (_view) => {
+ return {};
+ },
+ state: {
+ init: () => {
+ return {
+ selection: undefined,
+ };
+ },
+ apply: (tr, _oldState) => {
+ const meta = tr.getMeta("aiAgent");
+
+ if (!meta) {
+ return {
+ selection: undefined,
+ };
+ }
+
+ return {
+ selection: meta.selection,
+ };
+ },
+ },
+ props: {
+ decorations: (state) => {
+ const { doc } = state;
+
+ const { selection } = PLUGIN_KEY.getState(state)!;
+
+ const decs = [];
+
+ if (!selection) {
+ return DecorationSet.create(doc, []);
+ }
+
+ decs.push(
+ Decoration.widget(selection.head, () => renderCursor(user), {
+ key: "agent-cursor",
+ side: 10,
+ })
+ );
+
+ const from = Math.min(selection.anchor, selection.head);
+ const to = Math.max(selection.anchor, selection.head);
+
+ decs.push(
+ Decoration.inline(from, to, defaultSelectionBuilder(user), {
+ inclusiveEnd: true,
+ inclusiveStart: false,
+ })
+ );
+
+ return DecorationSet.create(doc, decs);
+ },
+ },
+ });
+ }
+}
+
+const renderCursor = (user: { name: string; color: string }) => {
+ const cursorElement = document.createElement("span");
+
+ cursorElement.classList.add("bn-collaboration-cursor__base");
+ cursorElement.setAttribute("data-active", "true");
+
+ const caretElement = document.createElement("span");
+ caretElement.setAttribute("contentedEditable", "false");
+ caretElement.classList.add("bn-collaboration-cursor__caret");
+ caretElement.setAttribute("style", `background-color: ${user.color}`);
+
+ const labelElement = document.createElement("span");
+
+ labelElement.classList.add("bn-collaboration-cursor__label");
+ labelElement.setAttribute("style", `background-color: ${user.color}`);
+ labelElement.insertBefore(document.createTextNode(user.name), null);
+
+ caretElement.insertBefore(labelElement, null);
+
+ cursorElement.insertBefore(document.createTextNode("\u2060"), null); // Non-breaking space
+ cursorElement.insertBefore(caretElement, null);
+ cursorElement.insertBefore(document.createTextNode("\u2060"), null); // Non-breaking space
+
+ return cursorElement;
+};
diff --git a/packages/core/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts b/packages/core/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts
index 907cb3435f..990017445a 100644
--- a/packages/core/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts
+++ b/packages/core/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts
@@ -25,7 +25,7 @@ export class FormattingToolbarView implements PluginView {
state: EditorState;
from: number;
to: number;
- }) => boolean = ({ state, from, to }) => {
+ }) => boolean = ({ view, state, from, to }) => {
const { doc, selection } = state;
const { empty } = selection;
@@ -43,7 +43,15 @@ export class FormattingToolbarView implements PluginView {
return false;
}
- return !(empty || isEmptyTextBlock);
+ if (empty || isEmptyTextBlock) {
+ return false;
+ }
+
+ if (!view.hasFocus() && view.editable) {
+ // editable editors must have focus for the toolbar to show
+ return false;
+ }
+ return true;
};
constructor(
diff --git a/packages/core/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts b/packages/core/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts
index 6789b76616..25a4b746fc 100644
--- a/packages/core/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts
+++ b/packages/core/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts
@@ -1,7 +1,5 @@
-import type { Dictionary } from "../../i18n/dictionary.js";
-
export type DefaultSuggestionItem = {
- key: keyof Omit;
+ key: string;
title: string;
onItemClick: () => void;
subtext?: string;
diff --git a/packages/core/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts b/packages/core/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts
index 8e27866cc0..73986f14ad 100644
--- a/packages/core/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts
+++ b/packages/core/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts
@@ -323,8 +323,9 @@ export function filterSuggestionItems<
({ title, aliases }) =>
title.toLowerCase().includes(query.toLowerCase()) ||
(aliases &&
- aliases.filter((alias) =>
- alias.toLowerCase().includes(query.toLowerCase())
+ aliases.filter(
+ (alias) =>
+ alias === "" || alias.toLowerCase().includes(query.toLowerCase())
).length !== 0)
);
}
diff --git a/packages/core/src/extensions/Suggestions/SuggestionMarks.ts b/packages/core/src/extensions/Suggestions/SuggestionMarks.ts
new file mode 100644
index 0000000000..4cbf19b567
--- /dev/null
+++ b/packages/core/src/extensions/Suggestions/SuggestionMarks.ts
@@ -0,0 +1,167 @@
+import { Mark } from "@tiptap/core";
+import { MarkSpec } from "prosemirror-model";
+
+// This copies the marks from @handlewithcare/prosemirror-suggest-changes,
+// but uses the Tiptap Mark API instead so we can use them in BlockNote
+
+// The ideal solution would be to not depend on tiptap nodes / marks, but be able to use prosemirror nodes / marks directly
+// this way we could directly use the exported marks from @handlewithcare/prosemirror-suggest-changes
+export const SuggestionAddMark = Mark.create({
+ name: "insertion",
+ inclusive: false,
+ excludes: "deletion modification insertion",
+ addAttributes() {
+ return {
+ id: { default: null, validate: "number" }, // note: validate is supported in prosemirror but not in tiptap, so this doesn't actually work (considered not critical)
+ };
+ },
+ extendMarkSchema(extension) {
+ if (extension.name !== "insertion") {
+ return {};
+ }
+ return {
+ blocknoteIgnore: true,
+ inclusive: false,
+
+ toDOM(mark, inline) {
+ return [
+ "ins",
+ {
+ "data-id": String(mark.attrs["id"]),
+ "data-inline": String(inline),
+ ...(!inline && { style: "display: block" }),
+ },
+ 0,
+ ];
+ },
+ parseDOM: [
+ {
+ tag: "ins",
+ getAttrs(node) {
+ if (!node.dataset["id"]) return false;
+ return {
+ id: parseInt(node.dataset["id"], 10),
+ };
+ },
+ },
+ ],
+ } satisfies MarkSpec;
+ },
+});
+
+export const SuggestionDeleteMark = Mark.create({
+ name: "deletion",
+ inclusive: false,
+ excludes: "insertion modification deletion",
+ addAttributes() {
+ return {
+ id: { default: null, validate: "number" }, // note: validate is supported in prosemirror but not in tiptap
+ };
+ },
+ extendMarkSchema(extension) {
+ if (extension.name !== "deletion") {
+ return {};
+ }
+ return {
+ blocknoteIgnore: true,
+ inclusive: false,
+
+ // attrs: {
+ // id: { validate: "number" },
+ // },
+ toDOM(mark, inline) {
+ return [
+ "del",
+ {
+ "data-id": String(mark.attrs["id"]),
+ "data-inline": String(inline),
+ ...(!inline && { style: "display: contents" }), // changed to "contents" to make this work for table rows
+ },
+ 0,
+ ];
+ },
+ parseDOM: [
+ {
+ tag: "del",
+ getAttrs(node) {
+ if (!node.dataset["id"]) return false;
+ return {
+ id: parseInt(node.dataset["id"], 10),
+ };
+ },
+ },
+ ],
+ } satisfies MarkSpec;
+ },
+});
+
+export const SuggestionModificationMark = Mark.create({
+ name: "modification",
+ inclusive: false,
+ excludes: "deletion insertion",
+ addAttributes() {
+ // note: validate is supported in prosemirror but not in tiptap
+ return {
+ id: { default: null, validate: "number" },
+ type: { validate: "string" },
+ attrName: { default: null, validate: "string|null" },
+ previousValue: { default: null },
+ newValue: { default: null },
+ };
+ },
+ extendMarkSchema(extension) {
+ if (extension.name !== "modification") {
+ return {};
+ }
+ return {
+ blocknoteIgnore: true,
+ inclusive: false,
+ // attrs: {
+ // id: { validate: "number" },
+ // type: { validate: "string" },
+ // attrName: { default: null, validate: "string|null" },
+ // previousValue: { default: null },
+ // newValue: { default: null },
+ // },
+ toDOM(mark, inline) {
+ return [
+ inline ? "span" : "div",
+ {
+ "data-type": "modification",
+ "data-id": String(mark.attrs["id"]),
+ "data-mod-type": mark.attrs["type"] as string,
+ "data-mod-prev-val": JSON.stringify(mark.attrs["previousValue"]),
+ // TODO: Try to serialize marks with toJSON?
+ "data-mod-new-val": JSON.stringify(mark.attrs["newValue"]),
+ },
+ 0,
+ ];
+ },
+ parseDOM: [
+ {
+ tag: "span[data-type='modification']",
+ getAttrs(node) {
+ if (!node.dataset["id"]) return false;
+ return {
+ id: parseInt(node.dataset["id"], 10),
+ type: node.dataset["modType"],
+ previousValue: node.dataset["modPrevVal"],
+ newValue: node.dataset["modNewVal"],
+ };
+ },
+ },
+ {
+ tag: "div[data-type='modification']",
+ getAttrs(node) {
+ if (!node.dataset["id"]) return false;
+ return {
+ id: parseInt(node.dataset["id"], 10),
+ type: node.dataset["modType"],
+ previousValue: node.dataset["modPrevVal"],
+ };
+ },
+ },
+ ],
+ } satisfies MarkSpec;
+ },
+});
diff --git a/packages/core/src/extensions/TextAlignment/TextAlignmentExtension.ts b/packages/core/src/extensions/TextAlignment/TextAlignmentExtension.ts
index cabde01b91..ba43c8fb1a 100644
--- a/packages/core/src/extensions/TextAlignment/TextAlignmentExtension.ts
+++ b/packages/core/src/extensions/TextAlignment/TextAlignmentExtension.ts
@@ -21,7 +21,11 @@ export const TextAlignmentExtension = Extension.create({
textAlignment: {
default: "left",
parseHTML: (element) => {
- return element.getAttribute("data-text-alignment");
+ return (
+ element.getAttribute("data-text-alignment") ||
+ element.style.textAlign || // TODO: also do better parsing for other marks?
+ undefined
+ );
},
renderHTML: (attributes) => {
if (attributes.textAlignment === "left") {
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index be7060c85d..d6561eac10 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -1,10 +1,18 @@
+// TODO: internal?
+export * from "./api/blockManipulation/commands/insertBlocks/insertBlocks.js";
+export * from "./api/blockManipulation/commands/replaceBlocks/replaceBlocks.js";
export * from "./api/blockManipulation/commands/updateBlock/updateBlock.js";
+
export * from "./api/exporters/html/externalHTMLExporter.js";
export * from "./api/exporters/html/internalHTMLSerializer.js";
export * from "./api/getBlockInfoFromPos.js";
export * from "./api/nodeUtil.js";
export * from "./blocks/AudioBlockContent/AudioBlockContent.js";
export * from "./blocks/CodeBlockContent/CodeBlockContent.js";
+export * from "./blocks/defaultBlockHelpers.js";
+export * from "./blocks/defaultBlocks.js";
+export * from "./blocks/defaultBlockTypeGuards.js";
+export * from "./blocks/defaultProps.js";
export * from "./blocks/FileBlockContent/FileBlockContent.js";
export * from "./blocks/FileBlockContent/helpers/parse/parseEmbedElement.js";
export * from "./blocks/FileBlockContent/helpers/parse/parseFigureElement.js";
@@ -16,19 +24,16 @@ export * from "./blocks/FileBlockContent/helpers/toExternalHTML/createFigureWith
export * from "./blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js";
export * from "./blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js";
export * from "./blocks/ImageBlockContent/ImageBlockContent.js";
-export * from "./blocks/PageBreakBlockContent/PageBreakBlockContent.js";
export * from "./blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.js";
+export * from "./blocks/PageBreakBlockContent/PageBreakBlockContent.js";
export * from "./blocks/PageBreakBlockContent/schema.js";
export {
EMPTY_CELL_HEIGHT,
EMPTY_CELL_WIDTH,
} from "./blocks/TableBlockContent/TableExtension.js";
export * from "./blocks/VideoBlockContent/VideoBlockContent.js";
-export * from "./blocks/defaultBlockHelpers.js";
-export * from "./blocks/defaultBlockTypeGuards.js";
-export * from "./blocks/defaultBlocks.js";
-export * from "./blocks/defaultProps.js";
export * from "./editor/BlockNoteEditor.js";
+export * from "./editor/BlockNoteExtension.js";
export * from "./editor/BlockNoteExtensions.js";
export * from "./editor/BlockNoteSchema.js";
export * from "./editor/defaultColors.js";
@@ -42,22 +47,24 @@ export * from "./extensions/LinkToolbar/protocols.js";
export * from "./extensions/SideMenu/SideMenuPlugin.js";
export * from "./extensions/SuggestionMenu/DefaultGridSuggestionItem.js";
export * from "./extensions/SuggestionMenu/DefaultSuggestionItem.js";
-export * from "./extensions/SuggestionMenu/SuggestionPlugin.js";
export * from "./extensions/SuggestionMenu/getDefaultEmojiPickerItems.js";
export * from "./extensions/SuggestionMenu/getDefaultSlashMenuItems.js";
+export * from "./extensions/SuggestionMenu/SuggestionPlugin.js";
export * from "./extensions/TableHandles/TableHandlesPlugin.js";
export * from "./i18n/dictionary.js";
export * from "./schema/index.js";
export * from "./util/browser.js";
export * from "./util/combineByGroup.js";
export * from "./util/esmDependencies.js";
-export * from "./util/table.js";
export * from "./util/string.js";
+export * from "./util/table.js";
export * from "./util/typescript.js";
export type { CodeBlockOptions } from "./blocks/CodeBlockContent/CodeBlockContent.js";
-export { UnreachableCaseError, assertEmpty } from "./util/typescript.js";
+export { assertEmpty, UnreachableCaseError } from "./util/typescript.js";
+export * from "./util/EventEmitter.js";
+// for testing from react (TODO: move):
// Unit testing
export { selectedFragmentToHTML } from "./api/clipboard/toClipboard/copyExtension.js";
@@ -70,3 +77,7 @@ export * from "./extensions/UniqueID/UniqueID.js";
export * from "./api/exporters/markdown/markdownExporter.js";
export * from "./api/parsers/html/parseHTML.js";
export * from "./api/parsers/markdown/parseMarkdown.js";
+
+// TODO: for ai, remove?
+export * from "./api/blockManipulation/getBlock/getBlock.js";
+export * from "./api/positionMapping.js";
diff --git a/packages/core/src/pm-nodes/BlockContainer.ts b/packages/core/src/pm-nodes/BlockContainer.ts
index ecd7f8068f..7d228a28bc 100644
--- a/packages/core/src/pm-nodes/BlockContainer.ts
+++ b/packages/core/src/pm-nodes/BlockContainer.ts
@@ -27,7 +27,7 @@ export const BlockContainer = Node.create<{
// Ensures content-specific keyboard handlers trigger first.
priority: 50,
defining: true,
-
+ marks: "insertion modification deletion",
parseHTML() {
return [
{
diff --git a/packages/core/src/pm-nodes/BlockGroup.ts b/packages/core/src/pm-nodes/BlockGroup.ts
index 820b7eeb9d..3519a0cab9 100644
--- a/packages/core/src/pm-nodes/BlockGroup.ts
+++ b/packages/core/src/pm-nodes/BlockGroup.ts
@@ -8,7 +8,7 @@ export const BlockGroup = Node.create<{
name: "blockGroup",
group: "childContainer",
content: "blockGroupChild+",
-
+ marks: "deletion insertion modification",
parseHTML() {
return [
{
diff --git a/packages/core/src/pm-nodes/Doc.ts b/packages/core/src/pm-nodes/Doc.ts
index 69d086b5d4..40af17b7fa 100644
--- a/packages/core/src/pm-nodes/Doc.ts
+++ b/packages/core/src/pm-nodes/Doc.ts
@@ -1,7 +1,8 @@
-import {Node} from "@tiptap/core";
+import { Node } from "@tiptap/core";
export const Doc = Node.create({
- name: "doc",
- topNode: true,
- content: "blockGroup",
+ name: "doc",
+ topNode: true,
+ content: "blockGroup",
+ marks: "insertion modification deletion",
});
diff --git a/packages/dev-scripts/examples/template-react/package.json.template.tsx b/packages/dev-scripts/examples/template-react/package.json.template.tsx
index cd85f8b850..bc32a79b47 100644
--- a/packages/dev-scripts/examples/template-react/package.json.template.tsx
+++ b/packages/dev-scripts/examples/template-react/package.json.template.tsx
@@ -1,7 +1,7 @@
import type { Project } from "../util";
const template = (project: Project) => ({
- name: "@blocknote/example-" + project.projectSlug,
+ name: "@blocknote/example-" + project.fullSlug.replace("/", "-"),
description: "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
private: true,
version: "0.12.4",
@@ -9,7 +9,7 @@ const template = (project: Project) => ({
start: "vite",
dev: "vite",
"build:prod": "tsc && vite build",
- preview: "vite preview"
+ preview: "vite preview",
},
dependencies: {
"@blocknote/core": "latest",
@@ -27,7 +27,7 @@ const template = (project: Project) => ({
"@vitejs/plugin-react": "^4.3.1",
vite: "^5.3.4",
...(project.config?.devDependencies || {}),
- }
+ },
});
export default template;
diff --git a/packages/mantine/package.json b/packages/mantine/package.json
index bc9fbc2fbc..b58a54b5fa 100644
--- a/packages/mantine/package.json
+++ b/packages/mantine/package.json
@@ -52,7 +52,8 @@
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "eslint src --max-warnings 0",
- "clean": "rimraf dist && rimraf types"
+ "clean": "rimraf dist && rimraf types",
+ "_prepare": "npm run build"
},
"dependencies": {
"@blocknote/core": "0.29.1",
diff --git a/packages/mantine/src/form/TextInput.tsx b/packages/mantine/src/form/TextInput.tsx
index e741deb46a..b781073588 100644
--- a/packages/mantine/src/form/TextInput.tsx
+++ b/packages/mantine/src/form/TextInput.tsx
@@ -1,6 +1,6 @@
import { TextInput as MantineTextInput } from "@mantine/core";
-import { assertEmpty } from "@blocknote/core";
+import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -12,13 +12,17 @@ export const TextInput = forwardRef<
className,
name,
label,
+ variant,
icon,
value,
autoFocus,
placeholder,
+ disabled,
onKeyDown,
onChange,
onSubmit,
+ autoComplete,
+ rightSection,
...rest
} = props;
@@ -27,7 +31,10 @@ export const TextInput = forwardRef<
return (
);
});
diff --git a/packages/mantine/src/style.css b/packages/mantine/src/style.css
index 7077fd87b4..23149a68e0 100644
--- a/packages/mantine/src/style.css
+++ b/packages/mantine/src/style.css
@@ -118,6 +118,12 @@
height: 32px;
}
+.bn-mantine .bn-mt-input-large .mantine-TextInput-input {
+ border: none;
+ font-size: 14px;
+ height: 52px;
+}
+
/* Mantine Tooltip component base styles */
.bn-mantine .mantine-Tooltip-tooltip {
background-color: transparent;
@@ -323,6 +329,12 @@
height: 52px;
}
+.bn-mantine .bn-suggestion-menu-item-small {
+ height: fit-content;
+ /* Made to match with labels */
+ padding: calc(var(--mantine-spacing-xs) / 2) var(--mantine-spacing-sm);
+}
+
.bn-mantine .bn-suggestion-menu-item[aria-selected="true"],
.bn-mantine .bn-suggestion-menu-item:hover {
background-color: var(--bn-colors-hovered-background);
@@ -338,6 +350,16 @@
padding: 8px;
}
+.bn-suggestion-menu-item-small .bn-mt-suggestion-menu-item-section[data-position="left"] {
+ background-color: transparent;
+ padding: 0;
+}
+
+.bn-suggestion-menu-item-small .bn-mt-suggestion-menu-item-section[data-position="left"] svg {
+ height: 14px;
+ width: 14px;
+}
+
.bn-mt-suggestion-menu-item-body {
align-items: stretch;
display: flex;
@@ -356,6 +378,10 @@
padding: 0;
}
+.bn-suggestion-menu-item-small .bn-mt-suggestion-menu-item-title {
+ font-size: 12px;
+}
+
.bn-mt-suggestion-menu-item-subtitle {
color: var(--bn-colors-menu-text);
line-height: 16px;
@@ -364,8 +390,13 @@
padding: 0;
}
+.bn-suggestion-menu-item-small .bn-mt-suggestion-menu-item-subtitle {
+ display: none;
+}
+
.bn-mantine .bn-suggestion-menu-label {
color: var(--bn-colors-hovered-text);
+ font-weight: bold;
}
.bn-mantine .bn-suggestion-menu-loader {
diff --git a/packages/mantine/src/suggestionMenu/SuggestionMenuItem.tsx b/packages/mantine/src/suggestionMenu/SuggestionMenuItem.tsx
index c7db27e386..a758c39da0 100644
--- a/packages/mantine/src/suggestionMenu/SuggestionMenuItem.tsx
+++ b/packages/mantine/src/suggestionMenu/SuggestionMenuItem.tsx
@@ -27,7 +27,7 @@ export const SuggestionMenuItem = forwardRef<
const overflow = elementOverflow(
itemRef.current,
- document.querySelector(".bn-suggestion-menu")!
+ document.querySelector(".bn-suggestion-menu, #ai-suggestion-menu")! // TODO
);
if (overflow === "top") {
@@ -44,6 +44,7 @@ export const SuggestionMenuItem = forwardRef<
ref={mergeRefs(ref, itemRef)}
id={id}
role="option"
+ onMouseDown={(event) => event.preventDefault()}
onClick={onClick}
aria-selected={isSelected || undefined}>
{item.icon && (
diff --git a/packages/mantine/src/toolbar/Toolbar.tsx b/packages/mantine/src/toolbar/Toolbar.tsx
index 60e12a6dbe..a003304e55 100644
--- a/packages/mantine/src/toolbar/Toolbar.tsx
+++ b/packages/mantine/src/toolbar/Toolbar.tsx
@@ -5,8 +5,7 @@ import { ComponentProps } from "@blocknote/react";
import { mergeRefs, useFocusTrap, useFocusWithin } from "@mantine/hooks";
import { forwardRef } from "react";
-type ToolbarProps = ComponentProps["FormattingToolbar"]["Root"] &
- ComponentProps["LinkToolbar"]["Root"];
+type ToolbarProps = ComponentProps["Generic"]["Toolbar"]["Root"];
export const Toolbar = forwardRef(
(props, ref) => {
diff --git a/packages/mantine/src/toolbar/ToolbarButton.tsx b/packages/mantine/src/toolbar/ToolbarButton.tsx
index 5f88256796..20628f884f 100644
--- a/packages/mantine/src/toolbar/ToolbarButton.tsx
+++ b/packages/mantine/src/toolbar/ToolbarButton.tsx
@@ -26,8 +26,7 @@ export const TooltipContent = (props: {
);
-type ToolbarButtonProps = ComponentProps["FormattingToolbar"]["Button"] &
- ComponentProps["LinkToolbar"]["Button"];
+type ToolbarButtonProps = ComponentProps["Generic"]["Toolbar"]["Button"];
/**
* Helper for basic buttons that show in the formatting toolbar.
@@ -132,10 +131,12 @@ export const ToolbarButton = forwardRef(
disabled={hideTooltip}
withinPortal={false}
label={
-
+ mainTooltip && (
+
+ )
}>
{button}
diff --git a/packages/react/package.json b/packages/react/package.json
index e154caa9f9..fd41fb9883 100644
--- a/packages/react/package.json
+++ b/packages/react/package.json
@@ -54,7 +54,8 @@
"lint": "eslint src --max-warnings 0",
"test": "vitest --run",
"test:watch": "vitest --watch",
- "clean": "rimraf dist && rimraf types"
+ "clean": "rimraf dist && rimraf types",
+ "_prepare": "npm run build"
},
"dependencies": {
"@blocknote/core": "0.29.1",
diff --git a/packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx b/packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx
index c37e27b967..8f4abde51f 100644
--- a/packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx
+++ b/packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx
@@ -35,6 +35,8 @@ export type BlockTypeSelectItem = {
isSelected: (
block: Block
) => boolean;
+ showWhileSelected?: boolean;
+ showWhileNotSelected?: boolean;
};
export const blockTypeSelectItems = (
@@ -117,10 +119,21 @@ export const BlockTypeSelect = (props: { items?: BlockTypeSelectItem[] }) => {
const [block, setBlock] = useState(editor.getTextCursorPosition().block);
const filteredItems: BlockTypeSelectItem[] = useMemo(() => {
- return (props.items || blockTypeSelectItems(dict)).filter(
- (item) => item.type in editor.schema.blockSchema
- );
- }, [editor, dict, props.items]);
+ return (props.items || blockTypeSelectItems(dict)).filter((item) => {
+ const blockTypeInSchema = item.type in editor.schema.blockSchema;
+ const isSelected = item.isSelected(block);
+
+ const showWhileSelected =
+ item.showWhileSelected === undefined || item.showWhileSelected;
+ const showWhileNotSelected =
+ item.showWhileNotSelected === undefined || item.showWhileNotSelected;
+
+ return (
+ blockTypeInSchema &&
+ (isSelected ? showWhileSelected : showWhileNotSelected)
+ );
+ });
+ }, [props.items, dict, editor.schema.blockSchema, block]);
const shouldShow: boolean = useMemo(
() => filteredItems.find((item) => item.type === block.type) !== undefined,
diff --git a/packages/react/src/components/SideMenu/SideMenu.tsx b/packages/react/src/components/SideMenu/SideMenu.tsx
index d9f8fa6c3d..8f498700f5 100644
--- a/packages/react/src/components/SideMenu/SideMenu.tsx
+++ b/packages/react/src/components/SideMenu/SideMenu.tsx
@@ -48,6 +48,10 @@ export const SideMenu = <
}
}
+ if (props.block.type === "ai" && props.block.props.prompt) {
+ attrs["data-prompt"] = props.block.props.prompt.toString();
+ }
+
return attrs;
}, [props.block, props.editor.schema.blockSchema]);
diff --git a/packages/react/src/components/SuggestionMenu/GridSuggestionMenu/hooks/useGridSuggestionMenuKeyboardNavigation.ts b/packages/react/src/components/SuggestionMenu/GridSuggestionMenu/hooks/useGridSuggestionMenuKeyboardNavigation.ts
index 89875a1e6b..230cc998f7 100644
--- a/packages/react/src/components/SuggestionMenu/GridSuggestionMenu/hooks/useGridSuggestionMenuKeyboardNavigation.ts
+++ b/packages/react/src/components/SuggestionMenu/GridSuggestionMenu/hooks/useGridSuggestionMenuKeyboardNavigation.ts
@@ -53,6 +53,7 @@ export function useGridSuggestionMenuKeyboardNavigation(
}
if (event.key === "Enter" && !event.isComposing) {
+ event.stopPropagation();
event.preventDefault();
if (items.length) {
diff --git a/packages/react/src/components/SuggestionMenu/SuggestionMenu.test.tsx b/packages/react/src/components/SuggestionMenu/SuggestionMenu.test.tsx
index 4e5e1d77fb..386f2d6078 100644
--- a/packages/react/src/components/SuggestionMenu/SuggestionMenu.test.tsx
+++ b/packages/react/src/components/SuggestionMenu/SuggestionMenu.test.tsx
@@ -6,7 +6,7 @@ it("has good typing", () => {
let menu = (
// @ts-expect-error
[{ name: "hello" }]}
+ getItems={async () => [{ key: "hello" }]}
triggerCharacter="/"
/>
);
@@ -16,6 +16,7 @@ it("has good typing", () => {
[
{
+ key: "hello",
title: "hello",
onItemClick: () => {
return;
diff --git a/packages/react/src/components/SuggestionMenu/SuggestionMenu.tsx b/packages/react/src/components/SuggestionMenu/SuggestionMenu.tsx
index 78eaa0ab31..b2fc1a755d 100644
--- a/packages/react/src/components/SuggestionMenu/SuggestionMenu.tsx
+++ b/packages/react/src/components/SuggestionMenu/SuggestionMenu.tsx
@@ -1,3 +1,4 @@
+import { mergeCSSClasses } from "@blocknote/core";
import { useMemo } from "react";
import { useComponentsContext } from "../../editor/ComponentsContext.js";
@@ -38,7 +39,10 @@ export function SuggestionMenu(
renderedItems.push(
= {
heading: RiH1,
heading_2: RiH2,
heading_3: RiH3,
diff --git a/packages/react/src/components/SuggestionMenu/hooks/useSuggestionMenuKeyboardHandler.ts b/packages/react/src/components/SuggestionMenu/hooks/useSuggestionMenuKeyboardHandler.ts
new file mode 100644
index 0000000000..8d367ffdcf
--- /dev/null
+++ b/packages/react/src/components/SuggestionMenu/hooks/useSuggestionMenuKeyboardHandler.ts
@@ -0,0 +1,59 @@
+import React, { useState } from "react";
+
+// Hook which returns a handler for keyboard navigation of a suggestion menu. Up
+// & down arrow keys are used to select an item, enter is used to execute it.
+export function useSuggestionMenuKeyboardHandler(
+ items: Item[],
+ onItemClick?: (item: Item) => void
+) {
+ const [selectedIndex, setSelectedIndex] = useState(0);
+
+ return {
+ selectedIndex,
+ setSelectedIndex,
+ handler: (event: KeyboardEvent | React.KeyboardEvent) => {
+ if (event.key === "ArrowUp") {
+ event.preventDefault();
+
+ if (items.length) {
+ setSelectedIndex((selectedIndex - 1 + items!.length) % items!.length);
+ }
+
+ return true;
+ }
+
+ if (event.key === "ArrowDown") {
+ // debugger;
+ event.preventDefault();
+
+ if (items.length) {
+ setSelectedIndex((selectedIndex + 1) % items!.length);
+ }
+
+ return true;
+ }
+
+ const isComposing = isReactEvent(event)
+ ? event.nativeEvent.isComposing
+ : event.isComposing;
+ if (event.key === "Enter" && !isComposing) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ if (items.length) {
+ onItemClick?.(items[selectedIndex]);
+ }
+
+ return true;
+ }
+
+ return false;
+ },
+ };
+}
+
+function isReactEvent(
+ event: KeyboardEvent | React.KeyboardEvent
+): event is React.KeyboardEvent {
+ return (event as React.KeyboardEvent).nativeEvent !== undefined;
+}
diff --git a/packages/react/src/components/SuggestionMenu/hooks/useSuggestionMenuKeyboardNavigation.ts b/packages/react/src/components/SuggestionMenu/hooks/useSuggestionMenuKeyboardNavigation.ts
index 8a9bb1019c..d1fdb82e31 100644
--- a/packages/react/src/components/SuggestionMenu/hooks/useSuggestionMenuKeyboardNavigation.ts
+++ b/packages/react/src/components/SuggestionMenu/hooks/useSuggestionMenuKeyboardNavigation.ts
@@ -1,5 +1,6 @@
import { BlockNoteEditor } from "@blocknote/core";
-import { useEffect, useState } from "react";
+import { useEffect } from "react";
+import { useSuggestionMenuKeyboardHandler } from "./useSuggestionMenuKeyboardHandler.js";
// Hook which handles keyboard navigation of a suggestion menu. Up & down arrow
// keys are used to select a menu item, enter is used to execute it.
@@ -7,65 +8,28 @@ export function useSuggestionMenuKeyboardNavigation(
editor: BlockNoteEditor,
query: string,
items: Item[],
- onItemClick?: (item: Item) => void
+ onItemClick?: (item: Item) => void,
+ element?: HTMLElement
) {
- const [selectedIndex, setSelectedIndex] = useState(0);
+ const { selectedIndex, setSelectedIndex, handler } =
+ useSuggestionMenuKeyboardHandler(items, onItemClick);
useEffect(() => {
- const handleMenuNavigationKeys = (event: KeyboardEvent) => {
- if (event.key === "ArrowUp") {
- event.preventDefault();
-
- if (items.length) {
- setSelectedIndex((selectedIndex - 1 + items!.length) % items!.length);
- }
-
- return true;
- }
-
- if (event.key === "ArrowDown") {
- event.preventDefault();
-
- if (items.length) {
- setSelectedIndex((selectedIndex + 1) % items!.length);
- }
-
- return true;
- }
-
- if (event.key === "Enter" && !event.isComposing) {
- event.preventDefault();
- event.stopPropagation();
-
- if (items.length) {
- onItemClick?.(items[selectedIndex]);
- }
-
- return true;
- }
-
- return false;
- };
-
- editor.domElement?.addEventListener(
- "keydown",
- handleMenuNavigationKeys,
- true
- );
+ (element || editor.domElement)?.addEventListener("keydown", handler, true);
return () => {
- editor.domElement?.removeEventListener(
+ (element || editor.domElement)?.removeEventListener(
"keydown",
- handleMenuNavigationKeys,
+ handler,
true
);
};
- }, [editor.domElement, items, selectedIndex, onItemClick]);
+ }, [editor.domElement, items, selectedIndex, onItemClick, element, handler]);
// Resets index when items change
useEffect(() => {
setSelectedIndex(0);
- }, [query]);
+ }, [query, setSelectedIndex]);
return {
selectedIndex: items.length === 0 ? undefined : selectedIndex,
diff --git a/packages/react/src/components/SuggestionMenu/types.tsx b/packages/react/src/components/SuggestionMenu/types.tsx
index a3d7968331..8d9029046f 100644
--- a/packages/react/src/components/SuggestionMenu/types.tsx
+++ b/packages/react/src/components/SuggestionMenu/types.tsx
@@ -4,8 +4,9 @@ import { DefaultSuggestionItem } from "@blocknote/core";
* Although any arbitrary data can be passed as suggestion items, the built-in
* UI components such as `MantineSuggestionMenu` expect a shape that conforms to DefaultSuggestionItem
*/
-export type DefaultReactSuggestionItem = Omit & {
+export type DefaultReactSuggestionItem = DefaultSuggestionItem & {
icon?: JSX.Element;
+ size?: "default" | "small";
};
/**
diff --git a/packages/react/src/editor/ComponentsContext.tsx b/packages/react/src/editor/ComponentsContext.tsx
index 19f404e8d7..c72c267f1a 100644
--- a/packages/react/src/editor/ComponentsContext.tsx
+++ b/packages/react/src/editor/ComponentsContext.tsx
@@ -3,6 +3,7 @@ import {
ComponentType,
createContext,
CSSProperties,
+ HTMLInputAutoCompleteAttribute,
KeyboardEvent,
MouseEvent,
ReactNode,
@@ -141,7 +142,7 @@ export type ComponentProps = {
id: string;
isSelected: boolean;
onClick: () => void;
- item: DefaultReactSuggestionItem;
+ item: Omit;
};
Label: {
className?: string;
@@ -261,13 +262,17 @@ export type ComponentProps = {
className?: string;
name: string;
label?: string;
+ variant?: "default" | "large";
icon: ReactNode;
+ rightSection?: ReactNode;
autoFocus?: boolean;
- placeholder: string;
+ placeholder?: string;
+ disabled?: boolean;
value: string;
onKeyDown: (event: KeyboardEvent) => void;
onChange: (event: ChangeEvent) => void;
onSubmit?: () => void;
+ autoComplete?: HTMLInputAutoCompleteAttribute;
};
};
Menu: {
diff --git a/packages/react/src/editor/styles.css b/packages/react/src/editor/styles.css
index eed164ff37..878f988422 100644
--- a/packages/react/src/editor/styles.css
+++ b/packages/react/src/editor/styles.css
@@ -39,8 +39,8 @@
--bn-colors-highlights-pink-background: #f4dfeb;
--bn-font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
- "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
- "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
+ "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
+ "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
--bn-border-radius: 6px;
/* Derived values */
@@ -112,8 +112,8 @@
/* Indent line styling */
.bn-block-group
-.bn-block-group
-.bn-block-outer:not([data-prev-depth-changed])::before {
+ .bn-block-group
+ .bn-block-outer:not([data-prev-depth-changed])::before {
border-left: 1px solid var(--bn-colors-side-menu);
}
@@ -258,11 +258,11 @@
}
.bn-threads-sidebar .bn-thread.selected {
- background-color: #F5F9FD;
- border: 2px solid #C2DCF8;
+ background-color: #f5f9fd;
+ border: 2px solid #c2dcf8;
}
.dark .bn-threads-sidebar .bn-thread.selected {
- background-color: #20242A;
- border: 2px solid #23405B;
+ background-color: #20242a;
+ border: 2px solid #23405b;
}
diff --git a/packages/react/src/hooks/useUIElementPositioning.ts b/packages/react/src/hooks/useUIElementPositioning.ts
index 8fedd7c156..f5765deda6 100644
--- a/packages/react/src/hooks/useUIElementPositioning.ts
+++ b/packages/react/src/hooks/useUIElementPositioning.ts
@@ -4,9 +4,16 @@ import {
UseFloatingOptions,
useInteractions,
useTransitionStyles,
+ VirtualElement,
} from "@floating-ui/react";
import { useEffect, useMemo } from "react";
+type ReferencePos = DOMRect | HTMLElement | VirtualElement | null;
+
+function isVirtualElement(element: ReferencePos): element is VirtualElement {
+ return (element as VirtualElement).getBoundingClientRect !== undefined;
+}
+
type UIElementPosition = {
isMounted: boolean;
ref: (node: HTMLElement | null) => void;
@@ -18,9 +25,9 @@ type UIElementPosition = {
export function useUIElementPositioning(
show: boolean,
- referencePos: DOMRect | null,
+ referencePos: DOMRect | HTMLElement | VirtualElement | null,
zIndex: number,
- options?: Partial
+ options?: Partial
): UIElementPosition {
const { refs, update, context, floatingStyles } = useFloating({
open: show,
@@ -30,7 +37,7 @@ export function useUIElementPositioning(
// handle "escape" and other dismiss events, these will add some listeners to
// getFloatingProps which need to be attached to the floating element
- const dismiss = useDismiss(context);
+ const dismiss = useDismiss(context, { enabled: options?.canDismiss });
const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);
@@ -43,9 +50,16 @@ export function useUIElementPositioning(
if (referencePos === null) {
return;
}
- refs.setReference({
- getBoundingClientRect: () => referencePos,
- });
+
+ if (referencePos instanceof HTMLElement) {
+ refs.setReference(referencePos);
+ } else if (isVirtualElement(referencePos)) {
+ refs.setReference(referencePos);
+ } else {
+ refs.setReference({
+ getBoundingClientRect: () => referencePos,
+ });
+ }
}, [referencePos, refs]);
return useMemo(() => {
diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts
index 9341b46171..58c80ee271 100644
--- a/packages/react/src/index.ts
+++ b/packages/react/src/index.ts
@@ -78,11 +78,11 @@ export * from "./components/FilePanel/FilePanel.js";
export * from "./components/FilePanel/FilePanelController.js";
export * from "./components/FilePanel/FilePanelProps.js";
+export * from "./components/TableHandles/ExtendButton/ExtendButton.js";
+export * from "./components/TableHandles/ExtendButton/ExtendButtonProps.js";
export * from "./components/TableHandles/TableHandle.js";
export * from "./components/TableHandles/TableHandleProps.js";
export * from "./components/TableHandles/TableHandlesController.js";
-export * from "./components/TableHandles/ExtendButton/ExtendButton.js";
-export * from "./components/TableHandles/ExtendButton/ExtendButtonProps.js";
export * from "./components/TableHandles/hooks/useExtendButtonsPositioning.js";
export * from "./components/TableHandles/hooks/useTableHandlesPositioning.js";
@@ -126,3 +126,7 @@ export * from "./schema/ReactStyleSpec.js";
export * from "./util/elementOverflow.js";
export * from "./util/mergeRefs.js";
+
+export * from "./components/SuggestionMenu/hooks/useSuggestionMenuKeyboardHandler.js";
+export * from "./hooks/useUIElementPositioning.js";
+export * from "./hooks/useUIPluginState.js";
diff --git a/packages/server-util/package.json b/packages/server-util/package.json
index 1e1d7847f4..6d5b348e15 100644
--- a/packages/server-util/package.json
+++ b/packages/server-util/package.json
@@ -52,7 +52,8 @@
"build": "tsc && vite build",
"lint": "eslint src --max-warnings 0",
"test": "vitest --run",
- "test-watch": "vitest watch"
+ "test-watch": "vitest watch",
+ "_prepare": "npm run build"
},
"dependencies": {
"@blocknote/core": "0.29.1",
diff --git a/packages/shadcn/package.json b/packages/shadcn/package.json
index 3454eec888..28a7f19fd9 100644
--- a/packages/shadcn/package.json
+++ b/packages/shadcn/package.json
@@ -52,7 +52,8 @@
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "eslint src --max-warnings 0",
- "clean": "rimraf dist && rimraf types"
+ "clean": "rimraf dist && rimraf types",
+ "_prepare": "npm run build"
},
"dependencies": {
"@blocknote/core": "0.29.1",
diff --git a/packages/shadcn/src/form/TextInput.tsx b/packages/shadcn/src/form/TextInput.tsx
index 0aa393122e..71a3baeeb2 100644
--- a/packages/shadcn/src/form/TextInput.tsx
+++ b/packages/shadcn/src/form/TextInput.tsx
@@ -12,13 +12,17 @@ export const TextInput = forwardRef<
className,
name,
label,
+ variant,
icon, // TODO: implement
value,
autoFocus,
placeholder,
+ disabled,
onKeyDown,
onChange,
onSubmit,
+ autoComplete,
+ rightSection, // TODO: add rightSection
...rest
} = props;
@@ -33,10 +37,12 @@ export const TextInput = forwardRef<
name={name}
autoFocus={autoFocus}
placeholder={placeholder}
+ disabled={disabled}
value={value}
onKeyDown={onKeyDown}
onChange={onChange}
onSubmit={onSubmit}
+ autoComplete={autoComplete}
ref={ref}
/>
);
@@ -53,6 +59,7 @@ export const TextInput = forwardRef<
name={name}
autoFocus={autoFocus}
placeholder={placeholder}
+ disabled={disabled}
value={value}
onKeyDown={onKeyDown}
onChange={onChange}
diff --git a/packages/shadcn/src/suggestionMenu/SuggestionMenuItem.tsx b/packages/shadcn/src/suggestionMenu/SuggestionMenuItem.tsx
index 0ba138533d..5cbec26493 100644
--- a/packages/shadcn/src/suggestionMenu/SuggestionMenuItem.tsx
+++ b/packages/shadcn/src/suggestionMenu/SuggestionMenuItem.tsx
@@ -24,7 +24,7 @@ export const SuggestionMenuItem = forwardRef<
const overflow = elementOverflow(
itemRef.current,
- document.querySelector(".bn-suggestion-menu")!
+ document.querySelector(".bn-suggestion-menu, #ai-suggestion-menu")! // TODO
);
if (overflow === "top") {
itemRef.current.scrollIntoView(true);
@@ -38,21 +38,43 @@ export const SuggestionMenuItem = forwardRef<
// Styles from ShadCN DropdownMenuItem component
className={cn(
"bn-relative bn-flex bn-cursor-pointer bn-select-none bn-items-center bn-rounded-sm bn-px-2 bn-py-1.5 bn-text-sm bn-outline-none bn-transition-colors focus:bn-bg-accent focus:bn-text-accent-foreground data-[disabled]:bn-pointer-events-none data-[disabled]:bn-opacity-50",
+ props.item.size === "small" ? "bn-gap-3 bn-py-1" : "",
className
)}
ref={mergeRefs([ref, itemRef])}
id={id}
+ onMouseDown={(event) => event.preventDefault()}
onClick={onClick}
role="option"
aria-selected={isSelected || undefined}>
{item.icon && (
-
+
{item.icon}
)}
-
{item.title}
-
{item.subtext}
+
+ {item.title}
+
+
+ {item.subtext}
+
{item.badge && (
diff --git a/packages/shadcn/src/toolbar/Toolbar.tsx b/packages/shadcn/src/toolbar/Toolbar.tsx
index ba3fd592e7..06c05d59a7 100644
--- a/packages/shadcn/src/toolbar/Toolbar.tsx
+++ b/packages/shadcn/src/toolbar/Toolbar.tsx
@@ -5,8 +5,7 @@ import { forwardRef } from "react";
import { cn } from "../lib/utils.js";
import { useShadCNComponentsContext } from "../ShadCNComponentsContext.js";
-type ToolbarProps = ComponentProps["FormattingToolbar"]["Root"] &
- ComponentProps["LinkToolbar"]["Root"];
+type ToolbarProps = ComponentProps["Generic"]["Toolbar"]["Root"];
export const Toolbar = forwardRef(
(props, ref) => {
@@ -41,8 +40,7 @@ export const Toolbar = forwardRef(
}
);
-type ToolbarButtonProps = ComponentProps["FormattingToolbar"]["Button"] &
- ComponentProps["LinkToolbar"]["Button"];
+type ToolbarButtonProps = ComponentProps["Generic"]["Toolbar"]["Button"];
export const ToolbarButton = forwardRef(
(props, ref) => {
diff --git a/packages/xl-ai-server/.env.example b/packages/xl-ai-server/.env.example
new file mode 100644
index 0000000000..9847a1df18
--- /dev/null
+++ b/packages/xl-ai-server/.env.example
@@ -0,0 +1 @@
+OPENAI_API_KEY=
\ No newline at end of file
diff --git a/packages/xl-ai-server/README.md b/packages/xl-ai-server/README.md
new file mode 100644
index 0000000000..114334db58
--- /dev/null
+++ b/packages/xl-ai-server/README.md
@@ -0,0 +1,8 @@
+Requirements:
+
+- mkcert ([instructions](https://web.dev/articles/how-to-use-local-https))
+
+Running (dev mode):
+
+ mkcert localhost
+ npm run dev
diff --git a/packages/xl-ai-server/package.json b/packages/xl-ai-server/package.json
new file mode 100644
index 0000000000..01700b6576
--- /dev/null
+++ b/packages/xl-ai-server/package.json
@@ -0,0 +1,72 @@
+{
+ "name": "@blocknote/xl-ai-server",
+ "homepage": "https://github.com/TypeCellOS/BlockNote",
+ "private": false,
+ "license": "AGPL-3.0 OR PROPRIETARY",
+ "version": "0.26.0",
+ "files": [
+ "dist",
+ "types",
+ "src"
+ ],
+ "keywords": [
+ "react",
+ "javascript",
+ "editor",
+ "typescript",
+ "prosemirror",
+ "wysiwyg",
+ "rich-text-editor",
+ "notion",
+ "yjs",
+ "block-based",
+ "tiptap"
+ ],
+ "description": "A \"Notion-style\" block-based extensible text editor built on top of Prosemirror and Tiptap.",
+ "type": "module",
+ "source": "src/index.ts",
+ "types": "./types/src/index.d.ts",
+ "main": "./dist/blocknote-xl-ai-server.umd.cjs",
+ "module": "./dist/blocknote-xl-ai-server.js",
+ "exports": {
+ ".": {
+ "types": "./types/src/index.d.ts",
+ "import": "./dist/blocknote-xl-ai-server.js",
+ "require": "./dist/blocknote-xl-ai-server.umd.cjs"
+ }
+ },
+ "scripts": {
+ "dev": "vite-node src/index.ts",
+ "build": "tsc && vite build",
+ "start": "node dist/blocknote-xl-ai-server.js",
+ "lint": "eslint src --max-warnings 0",
+ "clean": "rimraf dist && rimraf types",
+ "test": "vitest --run",
+ "test-watch": "vitest watch"
+ },
+ "dependencies": {
+ "@hono/node-server": "^1.13.7",
+ "hono": "^4.6.12"
+ },
+ "devDependencies": {
+ "eslint": "^8.10.0",
+ "rimraf": "^5.0.5",
+ "rollup-plugin-webpack-stats": "^0.2.2",
+ "typescript": "^5.3.3",
+ "vite": "^5.3.4",
+ "vite-node": "^2.1.6",
+ "vite-plugin-eslint": "^1.8.1",
+ "vite-plugin-externalize-deps": "^0.8.0",
+ "vitest": "^2.0.3",
+ "undici": "^6"
+ },
+ "eslintConfig": {
+ "extends": [
+ "../../.eslintrc.js"
+ ]
+ },
+ "publishConfig": {
+ "access": "public",
+ "registry": "https://registry.npmjs.org/"
+ }
+}
diff --git a/packages/xl-ai-server/src/index.ts b/packages/xl-ai-server/src/index.ts
new file mode 100644
index 0000000000..8dc70b9f63
--- /dev/null
+++ b/packages/xl-ai-server/src/index.ts
@@ -0,0 +1,105 @@
+import { serve } from "@hono/node-server";
+import { Hono } from "hono";
+import { cors } from "hono/cors";
+import { existsSync, readFileSync } from "node:fs";
+import { createSecureServer } from "node:http2";
+import { Agent, setGlobalDispatcher } from "undici";
+
+// make sure our fetch request uses HTTP/2
+setGlobalDispatcher(
+ new Agent({
+ allowH2: true,
+ })
+);
+
+const ignoreHeadersRe = /^content-(?:encoding|length|range)$/i;
+
+export const proxyFetch: typeof fetch = async (request, options) => {
+ const req = new Request(request, options);
+ req.headers.delete("accept-encoding"); // TBD: there may be cases where you want to explicitly specify
+ const res = await fetch(req);
+
+ const headers: HeadersInit = [...res.headers.entries()].filter(
+ ([k]) => !ignoreHeadersRe.test(k) && k !== "strict-transport-security"
+ );
+ return new Response(res.body, {
+ ...res,
+ status: res.status,
+ statusText: res.statusText,
+ headers,
+ });
+};
+
+function getProviderInfo(provider: string) {
+ if (provider === "openai") {
+ return {
+ key: process.env.OPENAI_API_KEY,
+ };
+ }
+ if (provider === "groq") {
+ return {
+ key: process.env.GROQ_API_KEY,
+ };
+ }
+ if (provider === "albert-etalab") {
+ return {
+ key: process.env.ALBERT_ETALAB_API_KEY,
+ };
+ }
+ return "not-found";
+}
+
+const app = new Hono();
+
+app.use("/health", async (c) => {
+ return c.json({ status: "ok" });
+});
+
+app.use("/ai", cors(), async (c) => {
+ const url = c.req.query("url");
+ if (!url) {
+ return c.json({ error: "url parameter is required" }, 400);
+ }
+
+ const provider = c.req.query("provider");
+ if (!provider) {
+ return c.json({ error: "provider parameter is required" }, 400);
+ }
+
+ const providerInfo = getProviderInfo(provider);
+
+ if (providerInfo === "not-found" || !providerInfo.key?.length) {
+ return c.json(
+ {
+ error: `provider / key not found for provider ${provider}. Make sure to load correct env variables.`,
+ },
+ 404
+ );
+ }
+
+ // eslint-disable-next-line no-console
+ console.log("Proxying request to", url);
+ const request = new Request(url, c.req.raw);
+ request.headers.set("Authorization", `Bearer ${providerInfo.key}`);
+ return proxyFetch(request);
+});
+
+const http2 = existsSync("localhost.pem");
+serve(
+ {
+ fetch: app.fetch,
+ createServer: http2 ? createSecureServer : undefined,
+
+ serverOptions: {
+ key: http2 ? readFileSync("localhost-key.pem") : undefined,
+ cert: http2 ? readFileSync("localhost.pem") : undefined,
+ },
+ port: Number(process.env.PORT) || 3000,
+ },
+ (info) => {
+ // eslint-disable-next-line no-console
+ console.log(
+ `Server is running on ${info.address}${info.port}, http2: ${http2}`
+ );
+ }
+);
diff --git a/packages/xl-ai-server/tsconfig.json b/packages/xl-ai-server/tsconfig.json
new file mode 100644
index 0000000000..d9eced7daa
--- /dev/null
+++ b/packages/xl-ai-server/tsconfig.json
@@ -0,0 +1,32 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "useDefineForClassFields": true,
+ "module": "ESNext",
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
+ "moduleResolution": "Node",
+ "jsx": "react-jsx",
+ "strict": true,
+ "sourceMap": true,
+ "resolveJsonModule": true,
+ "esModuleInterop": true,
+ "noEmit": false,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noImplicitReturns": true,
+ "outDir": "dist",
+ "declaration": true,
+ "declarationDir": "types",
+ "composite": true,
+ "skipLibCheck": true
+ },
+ "include": ["src"],
+ "references": [
+ {
+ "path": "../core"
+ },
+ {
+ "path": "../react"
+ }
+ ]
+}
diff --git a/packages/xl-ai-server/vite.config.ts b/packages/xl-ai-server/vite.config.ts
new file mode 100644
index 0000000000..c2041c3105
--- /dev/null
+++ b/packages/xl-ai-server/vite.config.ts
@@ -0,0 +1,54 @@
+import * as path from "path";
+import { webpackStats } from "rollup-plugin-webpack-stats";
+import { defineConfig } from "vite";
+import pkg from "./package.json";
+// import eslintPlugin from "vite-plugin-eslint";
+
+// https://vitejs.dev/config/
+export default defineConfig((conf) => ({
+ test: {
+ environment: "jsdom",
+ setupFiles: ["./vitestSetup.ts"],
+ },
+ plugins: [webpackStats()],
+ // used so that vitest resolves the core package from the sources instead of the built version
+ resolve: {
+ alias:
+ conf.command === "build"
+ ? ({} as Record)
+ : ({
+ // load live from sources with live reload working
+ "@blocknote/core": path.resolve(__dirname, "../core/src/"),
+ } as Record),
+ },
+ build: {
+ sourcemap: true,
+ lib: {
+ entry: path.resolve(__dirname, "src/index.ts"),
+ name: "blocknote-xl-ai-server",
+ fileName: "blocknote-xl-ai-server",
+ },
+ rollupOptions: {
+ // make sure to externalize deps that shouldn't be bundled
+ // into your library
+ external: [
+ ...Object.keys({
+ ...pkg.dependencies,
+ ...pkg.peerDependencies,
+ ...pkg.devDependencies,
+ }),
+ "node:fs",
+ "node:http2",
+ ],
+ output: {
+ // Provide global variables to use in the UMD build
+ // for externalized deps
+ globals: {
+ react: "React",
+ "react-dom": "ReactDOM",
+ },
+ interop: "compat", // https://rollupjs.org/migration/#changed-defaults
+ },
+ },
+ },
+}));
diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json
new file mode 100644
index 0000000000..f3aa4726cf
--- /dev/null
+++ b/packages/xl-ai/package.json
@@ -0,0 +1,119 @@
+{
+ "name": "@blocknote/xl-ai",
+ "homepage": "https://github.com/TypeCellOS/BlockNote",
+ "private": false,
+ "license": "AGPL-3.0 OR PROPRIETARY",
+ "version": "0.26.0",
+ "files": [
+ "dist",
+ "types",
+ "src"
+ ],
+ "keywords": [
+ "react",
+ "javascript",
+ "editor",
+ "typescript",
+ "prosemirror",
+ "wysiwyg",
+ "rich-text-editor",
+ "notion",
+ "yjs",
+ "block-based",
+ "tiptap"
+ ],
+ "description": "A \"Notion-style\" block-based extensible text editor built on top of Prosemirror and Tiptap.",
+ "type": "module",
+ "source": "src/index.ts",
+ "types": "./types/src/index.d.ts",
+ "main": "./dist/blocknote-xl-ai.umd.cjs",
+ "module": "./dist/blocknote-xl-ai.js",
+ "exports": {
+ ".": {
+ "types": "./types/src/index.d.ts",
+ "import": "./dist/blocknote-xl-ai.js",
+ "require": "./dist/blocknote-xl-ai.umd.cjs"
+ },
+ "./style.css": {
+ "import": "./dist/style.css",
+ "require": "./dist/style.css"
+ }
+ },
+ "scripts": {
+ "dev": "vite",
+ "build": "tsc && vite build",
+ "build-bundled": "tsc && vite build --config vite.config.bundled.ts && git checkout tmp-releases && rm -rf ../../release && mv ../../release-tmp ../../release",
+ "preview": "vite preview",
+ "lint": "eslint src --max-warnings 0",
+ "clean": "rimraf dist && rimraf types",
+ "test": "NODE_EXTRA_CA_CERTS=\"$(mkcert -CAROOT)/rootCA.pem\" vitest --run",
+ "test-watch": "vitest watch",
+ "_prepare": "npm run build"
+ },
+ "dependencies": {
+ "@handlewithcare/prosemirror-suggest-changes": "^0.1.3",
+ "prosemirror-changeset": "^2.3.0",
+ "prosemirror-tables": "^1.6.4",
+ "prosemirror-transform": "^1.10.4",
+ "prosemirror-model": "^1.24.1",
+ "@ewoudenberg/difflib": "^0.1.0",
+ "@ai-sdk/openai-compatible": "^0.2.0",
+ "@ai-sdk/openai": "^1.3.0",
+ "@ai-sdk/groq": "^1.2.0",
+ "@blocknote/core": "workspace:*",
+ "@blocknote/mantine": "workspace:*",
+ "@blocknote/react": "workspace:*",
+ "@floating-ui/react": "^0.26.4",
+ "@tiptap/core": "^2.7.1",
+ "lodash.isequal": "^4.5.0",
+ "ai": "^4.2.1",
+ "diff": "^7.0.0",
+ "json-schema": "^0.4.0",
+ "json-diff": "^1.0.6",
+ "json-diff-kit": "^1.0.29",
+ "prosemirror-state": "^1.4.3",
+ "prosemirror-view": "^1.33.7",
+ "react": "^18",
+ "react-dom": "^18",
+ "react-icons": "^5.2.1",
+ "remark-parse": "^10.0.1",
+ "remark-stringify": "^10.0.2",
+ "unified": "^10.1.2",
+ "zustand": "^5.0.3"
+ },
+ "devDependencies": {
+ "@types/lodash.isequal": "^4.5.8",
+ "@types/diff": "^6.0.0",
+ "@types/json-diff": "^1.0.3",
+ "@types/react": "^18.0.25",
+ "@types/react-dom": "^18.0.9",
+ "@vitejs/plugin-react": "^4.3.1",
+ "eslint": "^8.10.0",
+ "@mswjs/interceptors": "^0.37.5",
+ "headers-polyfill": "^4.0.3",
+ "msw": "^2.7.3",
+ "msw-snapshot": "^5.2.0",
+ "rimraf": "^5.0.5",
+ "rollup-plugin-webpack-stats": "^0.2.2",
+ "typescript": "^5.3.3",
+ "vite": "^5.3.4",
+ "vite-plugin-eslint": "^1.8.1",
+ "vite-plugin-externalize-deps": "^0.8.0",
+ "vitest": "^2.0.3",
+ "@vitest/runner": "^2.0.3",
+ "undici": "^6"
+ },
+ "peerDependencies": {
+ "react": "^18",
+ "react-dom": "^18"
+ },
+ "eslintConfig": {
+ "extends": [
+ "../../.eslintrc.js"
+ ]
+ },
+ "publishConfig": {
+ "access": "public",
+ "registry": "https://registry.npmjs.org/"
+ }
+}
diff --git a/packages/xl-ai/src/AIExtension.ts b/packages/xl-ai/src/AIExtension.ts
new file mode 100644
index 0000000000..f9a4b37adc
--- /dev/null
+++ b/packages/xl-ai/src/AIExtension.ts
@@ -0,0 +1,278 @@
+import {
+ BlockNoteEditor,
+ BlockNoteExtension,
+ UnreachableCaseError,
+} from "@blocknote/core";
+import {
+ applySuggestions,
+ revertSuggestions,
+ suggestChanges,
+} from "@handlewithcare/prosemirror-suggest-changes";
+import { LanguageModel } from "ai";
+import { Plugin, PluginKey } from "prosemirror-state";
+import { fixTablesKey } from "prosemirror-tables";
+import { createStore } from "zustand/vanilla";
+import { PromptOrMessages, llm } from "./api";
+import { CallLLMResult } from "./api/formats/CallLLMResult";
+import { LLMRequestOptions } from "./api/streamTool/callLLMWithStreamTools";
+// type AIPluginState = {
+// aiMenuBlockID: string | undefined;
+// aiMenuResponseStatus: "initial" | "generating" | "error" | "done";
+// };
+
+type AIPluginState = {
+ /**
+ * zustand design considerations:
+ * - moved this to a nested object to have better typescript typing
+ * - if we'd do this without a nested object, then we could easily set "wrong" values,
+ * because "setState" takes a partial object (unless the second parameter "replace" = true),
+ * and thus we'd lose typescript's typing help
+ *
+ */
+ aiMenuState:
+ | {
+ blockId: string;
+ status:
+ | "user-input"
+ | "thinking"
+ | "ai-writing"
+ | "error"
+ | "user-reviewing";
+ }
+ | "closed";
+};
+
+// parameters that are shared across all calls and can be configured on the context as "application wide" settings
+type GlobalLLMCallOptions = {
+ model: LanguageModel;
+ dataFormat?: "html" | "json" | "markdown";
+ stream?: boolean;
+};
+
+// parameters that are specific to each call
+type CallSpecificCallLLMOptions = Partial &
+ Omit &
+ PromptOrMessages & {
+ 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;
+ };
+ };
+
+// TO DISCUSS: extension vs plugin vs addon vs ..
+export class AIExtension extends BlockNoteExtension {
+ public static name(): string {
+ return "ai";
+ }
+
+ /**
+ * zustand design considerations
+ *
+ * - setters are not added in this store, but as class methods so we can have control over what to expose as API
+ * - con: if we'd expose the store externally, consumers could still call store.setState :/ (for this store it's not desired, for `options` below, it is)
+ *
+ */
+ public readonly store = createStore()((_set) => ({
+ aiMenuState: "closed",
+ }));
+
+ /**
+ * zustand design considerations
+ *
+ * - I decided to create a separate store for the options as they feel quite different from "internal state"
+ * above. They're not so much "state", but more "configuration". I still think it's useful to have in a Zustand
+ * store (instead of a just a plain object), because consumers might want to display the settings in the UI.
+ * Case can also be made to make this a plain and leave the responsibility of displaying settings to the consumer
+ * (and not have a store for this at all). TO DISCUSS
+ */
+ public readonly options: ReturnType<
+ ReturnType>>
+ >;
+
+ // used for undo, not needed in store
+ // private prevDocument: typeof this.editor.document | undefined;
+
+ constructor(
+ public readonly editor: BlockNoteEditor,
+ options: GlobalLLMCallOptions
+ ) {
+ super();
+ this.options = createStore>()((_set) => ({
+ dataFormat: "html",
+ stream: true,
+ ...options,
+ }));
+ }
+
+ /**
+ * Open the AI menu at a specific block
+ */
+ public openAIMenuAtBlock(blockID: string) {
+ this.editor.setForceSelectionVisible(true);
+ this.editor.isEditable = false;
+ this.store.setState({
+ aiMenuState: {
+ blockId: blockID,
+ status: "user-input",
+ },
+ });
+ }
+
+ /**
+ * Close the AI menu
+ */
+ public closeAIMenu() {
+ this.store.setState({
+ aiMenuState: "closed",
+ });
+ this.editor.setForceSelectionVisible(false);
+ this.editor.isEditable = true;
+ this.editor.focus();
+ // this.prevDocument = undefined;
+ }
+
+ /**
+ * Accept the changes made by the LLM
+ */
+ public acceptChanges() {
+ applySuggestions(this.editor.prosemirrorState, (tr) => {
+ // TODO: @Nick, I don't think there's currently a cleaner way to do this?
+ this.editor._tiptapEditor.dispatch(tr);
+ });
+ this.closeAIMenu();
+ }
+
+ /**
+ * Reject the changes made by the LLM
+ */
+ public rejectChanges() {
+ revertSuggestions(this.editor.prosemirrorState, (tr) => {
+ // TODO: @Nick, I don't think there's currently a cleaner way to do this?
+ this.editor._tiptapEditor.dispatch(tr);
+ });
+ this.closeAIMenu();
+ }
+
+ /**
+ * Update the status of a call to an LLM
+ *
+ * @warning This method should usually only be used for advanced use-cases
+ * if you want to implement how an LLM call is executed. Usually, you should
+ * use {@link callLLM} instead.
+ */
+ public setAIResponseStatus(
+ status:
+ | "user-input"
+ | "thinking"
+ | "ai-writing"
+ | "error"
+ | "user-reviewing"
+ ) {
+ const aiMenuState = this.store.getState().aiMenuState;
+ if (aiMenuState === "closed") {
+ return; // TODO: log error?
+ }
+
+ if (status === "ai-writing") {
+ this.editor.setForceSelectionVisible(false);
+ }
+
+ this.store.setState({
+ aiMenuState: {
+ status: status,
+ blockId: aiMenuState.blockId,
+ },
+ });
+ }
+
+ /**
+ * Execute a call to an LLM and apply the result to the editor
+ */
+ public async callLLM(opts: CallSpecificCallLLMOptions) {
+ const options = {
+ ...this.options.getState(),
+ ...opts,
+ };
+
+ this.setAIResponseStatus("thinking");
+
+ try {
+ let ret: CallLLMResult;
+
+ // TODO: maybe separate functions for streaming / non-streaming?
+ if (options.dataFormat === "json") {
+ throw new Error("not implemented");
+ // ret = await llm.json.call(this.editor, options);
+ } else if (options.dataFormat === "markdown") {
+ throw new Error("not implemented");
+ // ret = await llm.markdown.call(this.editor, options);
+ } else if (options.dataFormat === "html") {
+ ret = await llm.html.call(this.editor, {
+ ...options,
+ onStart: () => {
+ this.setAIResponseStatus("ai-writing"); // TODO: also apply to other formats
+ },
+ });
+ } else {
+ throw new UnreachableCaseError(options.dataFormat);
+ }
+
+ // TODO: maybe split out the applying of operations
+ await ret.execute();
+ // for await (const operation of ret.applyToolCallsStream) {
+ // if (operation.result === "ok") {
+ // // TODO: check should be part of pipeline
+ // // NOTE: does this setState with an anon object trigger unnecessary re-renders?
+ // this.store.setState({
+ // aiMenuState: {
+ // blockId: operation.lastBlockId,
+ // status: "ai-writing",
+ // },
+ // });
+ // }
+ // }
+
+ this.setAIResponseStatus("user-reviewing");
+ } catch (e) {
+ this.setAIResponseStatus("error");
+ // eslint-disable-next-line no-console
+ console.warn("Error calling LLM", e);
+ }
+ }
+
+ public plugins = [
+ new Plugin({
+ key: PLUGIN_KEY,
+ filterTransaction: (tr) => {
+ const menuState = this.store.getState().aiMenuState;
+
+ if (menuState !== "closed" && menuState.status === "ai-writing") {
+ if (tr.getMeta(fixTablesKey)?.fixTables) {
+ // the fixtables plugin causes the steps between of the AI Agent to become invalid
+ // so we need to prevent it from running
+ // (we might need to filter out other / or maybe any transactions during the writing phase)
+ return false;
+ }
+ }
+ return true;
+ },
+ }),
+ suggestChanges(),
+ ];
+}
+
+const PLUGIN_KEY = new PluginKey(`blocknote-ai-plugin`);
+
+export function createAIExtension(options: GlobalLLMCallOptions) {
+ return (editor: BlockNoteEditor) => {
+ return new AIExtension(editor, options);
+ };
+}
+
+export function getAIExtension(editor: BlockNoteEditor) {
+ return editor.extension(AIExtension);
+}
diff --git a/packages/xl-ai/src/api/blocknoteAIClient/client.ts b/packages/xl-ai/src/api/blocknoteAIClient/client.ts
new file mode 100644
index 0000000000..24e83526c6
--- /dev/null
+++ b/packages/xl-ai/src/api/blocknoteAIClient/client.ts
@@ -0,0 +1,68 @@
+/**
+ * Fetch function to proxy requests to the @blocknote/xl-ai-server AI server.
+ */
+const fetchViaBlockNoteAIServer =
+ (baseURL: string, provider: 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
+ );
+ const resp = await fetch(newRequest);
+ return resp;
+ };
+
+/**
+ * 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),
+ };
+ },
+ };
+}
diff --git a/packages/xl-ai/src/api/executor/streamOperations/__snapshots__/changeset.test.ts.snap b/packages/xl-ai/src/api/executor/streamOperations/__snapshots__/changeset.test.ts.snap
new file mode 100644
index 0000000000..8884a24e5d
--- /dev/null
+++ b/packages/xl-ai/src/api/executor/streamOperations/__snapshots__/changeset.test.ts.snap
@@ -0,0 +1,21 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`update complex paragraph 1`] = `[]`;
+
+exports[`update simple paragraph 1`] = `
+[
+ {
+ "from": 3,
+ "slice": {
+ "content": [
+ {
+ "text": "What's up",
+ "type": "text",
+ },
+ ],
+ },
+ "stepType": "replace",
+ "to": 8,
+ },
+]
+`;
diff --git a/packages/xl-ai/src/api/executor/streamOperations/__snapshots__/partialUpdate.test.ts.snap b/packages/xl-ai/src/api/executor/streamOperations/__snapshots__/partialUpdate.test.ts.snap
new file mode 100644
index 0000000000..a3f35e3ab3
--- /dev/null
+++ b/packages/xl-ai/src/api/executor/streamOperations/__snapshots__/partialUpdate.test.ts.snap
@@ -0,0 +1,142 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`should be able to apply changes to a clean doc (use invertMap) 1`] = `
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "marks": [
+ {
+ "type": "deletion",
+ },
+ ],
+ "text": "Hello",
+ "type": "text",
+ },
+ {
+ "text": "What's up, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
+`;
+
+exports[`should be able to apply changes to a clean doc (use rebaseTr) 1`] = `
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "marks": [
+ {
+ "type": "deletion",
+ },
+ ],
+ "text": "Hello",
+ "type": "text",
+ },
+ {
+ "text": "What's up, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
+`;
+
+exports[`should create some example suggestions 1`] = `
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "marks": [
+ {
+ "type": "deletion",
+ },
+ ],
+ "text": "Hello",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "insertion",
+ },
+ ],
+ "text": "Hi",
+ "type": "text",
+ },
+ {
+ "text": ", world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
+`;
diff --git a/packages/xl-ai/src/api/executor/streamOperations/applyOperations.test.ts b/packages/xl-ai/src/api/executor/streamOperations/applyOperations.test.ts
new file mode 100644
index 0000000000..41e10cd1d3
--- /dev/null
+++ b/packages/xl-ai/src/api/executor/streamOperations/applyOperations.test.ts
@@ -0,0 +1,260 @@
+import { describe, expect, it } from "vitest";
+import {
+ getTestEditor,
+ testUpdateOperations,
+} from "../../../testUtil/updates/updateOperations.js";
+
+import {
+ BlockNoteEditor,
+ prosemirrorSliceToSlicedBlocks,
+} from "@blocknote/core";
+import { partialBlockToBlockForTesting } from "@shared/formatConversionTestUtil.js";
+import { getAIExtension } from "../../../AIExtension.js";
+import { CallLLMResult } from "../../formats/CallLLMResult.js";
+import { tools } from "../../formats/json/tools/index.js";
+import { AddBlocksToolCall } from "../../tools/createAddBlocksTool.js";
+import { UpdateBlockToolCall } from "../../tools/createUpdateBlockTool.js";
+import { DeleteBlockToolCall } from "../../tools/delete.js";
+import { createAsyncIterableStreamFromAsyncIterable } from "../../util/stream.js";
+
+// TODO: make possible to apply steps without agent mode
+// TODO: organize unit tests
+// TODO: fix unit tests
+
+describe("applyOperations", () => {
+ // Helper function to create a mock stream from operations
+ async function* createMockStream(
+ ...operations: {
+ operation:
+ | AddBlocksToolCall
+ | UpdateBlockToolCall
+ | DeleteBlockToolCall;
+ isUpdateToPreviousOperation?: boolean;
+ isPossiblyPartial?: boolean;
+ }[]
+ ) {
+ for (const op of operations) {
+ yield {
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ ...op,
+ };
+ }
+ }
+
+ // Helper function to process operations and return results
+ async function processOperations(
+ editor: BlockNoteEditor,
+ stream: AsyncIterable<{
+ operation:
+ | AddBlocksToolCall
+ | UpdateBlockToolCall
+ | DeleteBlockToolCall;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+ }>,
+ selection?: {
+ from: number;
+ to: number;
+ }
+ ) {
+
+ // TODO: idsSuffixed
+ const streamTools = [
+ tools.add(editor, {idsSuffixed: true, withDelays: false}),
+ tools.update(editor, {idsSuffixed: true, withDelays: false, updateSelection: selection}),
+ tools.delete(editor, {idsSuffixed: true, withDelays: false})
+ ];
+
+ const result = new CallLLMResult({
+ operationsSource: createAsyncIterableStreamFromAsyncIterable( stream),
+ streamObjectResult: undefined,
+ generateObjectResult: undefined,
+ }, streamTools);
+
+ await result.execute();
+
+ await getAIExtension(editor).acceptChanges();
+
+ return result;
+ }
+
+ it("should apply insert operations to the editor", async () => {
+ const editor = getTestEditor();
+ const insertOp = {
+ operation: {
+ type: "add",
+ blocks: [{ content: "block1" }],
+ referenceId: "ref1",
+ position: "after",
+ } as AddBlocksToolCall,
+ };
+
+ const result = await processOperations(editor, createMockStream(insertOp));
+
+ // Should call insertBlocks with the right parameters
+ expect(editor.document[1]).toMatchObject({
+ content: [{ text: "block1" }],
+ });
+
+ // Should yield the operation with result: "ok"
+ // expect(result.length).toBe(8);
+ // expect(result[0]).toEqual({
+ // isPossiblyPartial: false,
+ // isUpdateToPreviousOperation: false,
+ // lastBlockId: "0",
+ // operation: insertOp.operation,
+ // result: "ok",
+ // });
+ });
+
+ for (const testCase of testUpdateOperations) {
+ // eslint-disable-next-line no-loop-func
+ it(`should apply update operations to the editor (${testCase.description})`, async () => {
+
+ // TODO: quite some code duplicated here from other tests
+
+ const editor = testCase.editor();
+ const selection = testCase.getTestSelection?.(editor);
+
+ const result = await processOperations(
+ editor,
+ createMockStream({ operation: testCase.updateOp }),
+ selection
+ );
+
+ // Should call updateBlock with the right parameters
+ const update = testCase.updateOp.block;
+ let block = editor.getBlock(testCase.updateOp.id)!;
+ if (selection) {
+ const selectionInfo = prosemirrorSliceToSlicedBlocks(
+ editor.prosemirrorState.doc.slice(selection.from, selection.to, true),
+ editor.pmSchema
+ );
+ block = selectionInfo.blocks[0];
+ }
+ if (update.type) {
+ // eslint-disable-next-line
+ expect(block.type).toEqual(update.type);
+ }
+ if (update.props) {
+ // eslint-disable-next-line
+ expect(block.props).toMatchObject(update.props);
+ }
+
+ if (update.content) {
+ const partialBlock = {
+ type: block.type,
+ ...update,
+ };
+ // eslint-disable-next-line
+ expect(block.content).toEqual(
+ partialBlockToBlockForTesting(editor.schema.blockSchema, partialBlock)
+ .content
+ );
+ }
+
+ // Should yield the operation with result: "ok"
+ // expect(result.length).toBe(14);
+ // expect(result[0]).toEqual({
+ // isPossiblyPartial: false,
+ // isUpdateToPreviousOperation: false,
+ // lastBlockId: testCase.updateOp.id,
+ // operation: testCase.updateOp,
+ // result: "ok",
+ // });
+ });
+ }
+
+ it("should apply remove operations to the editor", async () => {
+ const editor = getTestEditor();
+ const startDocLength = editor.document.length;
+ const removeOp = {
+ operation: {
+ type: "delete",
+ id: "ref1",
+ } as DeleteBlockToolCall,
+ };
+
+ const result = await processOperations(editor, createMockStream(removeOp));
+
+ // Should call removeBlocks with the right parameters
+ expect(editor.document.length).toBe(startDocLength - 1);
+ expect(editor.document[0].id).toEqual("ref2");
+
+ // Should yield the operation with result: "ok"
+ // expect(result.length).toBe(2);
+ // expect(result[0]).toEqual({
+ // isPossiblyPartial: false,
+ // isUpdateToPreviousOperation: false,
+ // lastBlockId: "ref1",
+ // operation: removeOp.operation,
+ // result: "ok",
+ // });
+ });
+
+ it("should handle multiple operations in sequence", async () => {
+ const editor = getTestEditor();
+ const startDocLength = editor.document.length;
+ const insertOp = {
+ operation: {
+ type: "add",
+ blocks: [{ content: "block1" }],
+ referenceId: "ref1",
+ position: "before",
+ } as AddBlocksToolCall,
+ };
+
+ const updateOp = {
+ operation: {
+ type: "update",
+ id: "ref1",
+ block: { content: "updated content" },
+ } as UpdateBlockToolCall,
+ };
+
+ await processOperations(editor, createMockStream(insertOp, updateOp));
+
+ // Should call all the editor methods with the right parameters
+ expect(editor.document[0]).toMatchObject({
+ content: [{ text: "block1" }],
+ });
+
+ expect(editor.document[1]).toMatchObject({
+ content: [{ text: "updated content" }],
+ });
+
+ expect(editor.document.length).toBe(startDocLength + 1);
+ });
+
+ it("should handle multiple operations in sequence with selection", async () => {
+ const editor = getTestEditor();
+ const startDocLength = editor.document.length;
+ const insertOp = {
+ operation: {
+ type: "add",
+ blocks: [{ content: "block1" }],
+ referenceId: "ref1",
+ position: "before",
+ } as AddBlocksToolCall,
+ };
+
+ const updateOp = testUpdateOperations.filter(t => t.description === "translate selection")[0];
+
+ await processOperations(editor, createMockStream(insertOp, {
+ operation: updateOp.updateOp
+ }),updateOp.getTestSelection?.(editor));
+
+ // Should call all the editor methods with the right parameters
+ expect(editor.document[0]).toMatchObject({
+ content: [{ text: "block1" }],
+ });
+
+ expect((editor.document[2].content as any).length).toBeGreaterThan(1)
+ expect((editor.document[2].content as any)[0]).toMatchObject({
+ text: "Hallo, ",
+ });
+
+ expect(editor.document.length).toBe(startDocLength + 1);
+ });
+});
diff --git a/packages/xl-ai/src/api/executor/streamOperations/index.ts b/packages/xl-ai/src/api/executor/streamOperations/index.ts
new file mode 100644
index 0000000000..b3e46c7035
--- /dev/null
+++ b/packages/xl-ai/src/api/executor/streamOperations/index.ts
@@ -0,0 +1,4 @@
+export { filterNewOrUpdatedOperations } from "../../streamTool/filterNewOrUpdatedOperations.js";
+export { filterValidOperations } from "../../streamTool/filterValidOperations.js";
+export { toValidatedOperations } from "../../streamTool/toValidatedOperations.js";
+
diff --git a/packages/xl-ai/src/api/formats/CallLLMResult.ts b/packages/xl-ai/src/api/formats/CallLLMResult.ts
new file mode 100644
index 0000000000..e22401568b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/CallLLMResult.ts
@@ -0,0 +1,48 @@
+import { OperationsResult } from "../streamTool/callLLMWithStreamTools.js";
+import { StreamTool, StreamToolCall } from "../streamTool/streamTool.js";
+
+/**
+ * Result of an LLM call with stream tools that apply changes to a BlockNote Editor
+ */
+export class CallLLMResult {
+ /**
+ * @internal
+ */
+ constructor(
+ /**
+ * Result of the underlying LLM call. Use this to access operations the LLM decided to execute, but without applying them.
+ * (usually this is only used for advanced used cases or debugging)
+ */
+ public readonly llmResult: OperationsResult,
+
+ private readonly streamTools: StreamTool[]
+ ) {}
+
+ /**
+ * Apply the operations to the editor and return a stream of results.
+ *
+ * (this method consumes underlying streams in `llmResult`)
+ */
+ async *applyToolCalls() {
+ let currentStream: AsyncIterable<{
+ operation: StreamToolCall[]>;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+ }> = this.llmResult.operationsSource;
+ for (const tool of this.streamTools) {
+ currentStream = tool.execute(currentStream);
+ }
+ yield* currentStream;
+ }
+
+ /**
+ * Helper method to apply all operations to the editor if you're not interested in intermediate operations and results.
+ *
+ * (this method consumes underlying streams in `llmResult`)
+ */
+ public async execute() {
+ for await (const _result of this.applyToolCalls()) {
+ // no op
+ }
+ }
+}
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_67ad67d998b3861e118e79f058850d71.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_67ad67d998b3861e118e79f058850d71.json
new file mode 100644
index 0000000000..fdd275ebef
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_67ad67d998b3861e118e79f058850d71.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-282438c60350460387ae8ce72b8d98df\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-296666893e764673bed7630b67619803\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}]},\"stop_reason\":null}],\"created\":1742851930,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":18,\"prompt_tokens\":701,\"total_tokens\":719,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_7c8b43e8384b57453ff2fb1c2c6fdf81.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_7c8b43e8384b57453ff2fb1c2c6fdf81.json
new file mode 100644
index 0000000000..823972075e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_7c8b43e8384b57453ff2fb1c2c6fdf81.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_0ab073bcc3c486b078f476ffdac6a58a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_0ab073bcc3c486b078f476ffdac6a58a.json
new file mode 100644
index 0000000000..d293254ffd
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_0ab073bcc3c486b078f476ffdac6a58a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-02cc9c7a-1774-4fc4-a5c5-ba7c629842cb\",\"object\":\"chat.completion\",\"created\":1743024149,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_nja6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.100076155,\"prompt_tokens\":517,\"prompt_time\":0.043140061,\"completion_tokens\":20,\"completion_time\":0.072727273,\"total_tokens\":537,\"total_time\":0.115867334},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5bnb0errtwcryxpg00nq2\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_7e9b2f6b5409654cd6b57fa6e5fd6aa0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_7e9b2f6b5409654cd6b57fa6e5fd6aa0.json
new file mode 100644
index 0000000000..90ac08f3b9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_7e9b2f6b5409654cd6b57fa6e5fd6aa0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-312dbd54-d398-427f-92e1-0af2590252ef\",\"object\":\"chat.completion\",\"created\":1742851854,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_sg9t\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.100994052,\"prompt_tokens\":526,\"prompt_time\":0.043698667,\"completion_tokens\":20,\"completion_time\":0.086386606,\"total_tokens\":546,\"total_time\":0.130085273},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jq511kkqeyn95w1f03wek0p6\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5f3e7fc087bb309fd89081e38606ddf0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5f3e7fc087bb309fd89081e38606ddf0.json
new file mode 100644
index 0000000000..9407d63b4f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5f3e7fc087bb309fd89081e38606ddf0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 500,
+ "statusText": "",
+ "body": "{\"error\":{\"message\":\"Internal Server Error\",\"type\":\"internal_server_error\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5fea20ff83184b31232306376465676b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5fea20ff83184b31232306376465676b.json
new file mode 100644
index 0000000000..8abe1590d5
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5fea20ff83184b31232306376465676b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-284ff145-1a50-4da1-9708-9da2d2bec22d\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5azrdfctttc5v721akq72\"}}\n\ndata: {\"id\":\"chatcmpl-284ff145-1a50-4da1-9708-9da2d2bec22d\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_3mmp\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-284ff145-1a50-4da1-9708-9da2d2bec22d\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5azrdfctttc5v721akq72\",\"usage\":{\"queue_time\":0.10079558999999999,\"prompt_tokens\":517,\"prompt_time\":0.035746723,\"completion_tokens\":20,\"completion_time\":0.072727273,\"total_tokens\":537,\"total_time\":0.108473996}}}\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/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_23e8f44d81973df34c7b6f85390c4790.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_23e8f44d81973df34c7b6f85390c4790.json
new file mode 100644
index 0000000000..360bea4fbe
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_23e8f44d81973df34c7b6f85390c4790.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjephIWMVdDsvbxZrZwQWPTExMuU\",\n \"object\": \"chat.completion\",\n \"created\": 1742851799,\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_YSMMaU2rmjiWs1g8SToJg6Mm\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"0$\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 233,\n \"completion_tokens\": 15,\n \"total_tokens\": 248,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_2d4ce8c62140381657e89b60f9187d93.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_2d4ce8c62140381657e89b60f9187d93.json
new file mode 100644
index 0000000000..a473f6040c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_2d4ce8c62140381657e89b60f9187d93.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"0$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTw0AFpS7e137WkykmweNHgoG5ugz\",\n \"object\": \"chat.completion\",\n \"created\": 1746474170,\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_pD0S2PQ1evDgz9Wgy09347iM\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"0$\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 436,\n \"completion_tokens\": 15,\n \"total_tokens\": 451,\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_d8864f8b6b\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_d6a5926f616cd39868003ab44b47d729.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_d6a5926f616cd39868003ab44b47d729.json
new file mode 100644
index 0000000000..a46c41c19c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_d6a5926f616cd39868003ab44b47d729.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSU92rV5IsLEPlfezAYpeQlNJ5SG\",\n \"object\": \"chat.completion\",\n \"created\": 1743024117,\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_HIYC3orGOIz1JNkL1NWEOllD\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"0$\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 224,\n \"completion_tokens\": 15,\n \"total_tokens\": 239,\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_6bb567654c\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_82174239ff8eda6117584628090a4631.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_82174239ff8eda6117584628090a4631.json
new file mode 100644
index 0000000000..753897445c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_82174239ff8eda6117584628090a4631.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"0$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_aerjRizF143Ctc85DWoveCmp\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"delete\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUjMMotQ7519DCn1tjtBXWNS4Vf8\",\"object\":\"chat.completion.chunk\",\"created\":1746607668,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_a1935cff87bcd9476747bdc06c5b1077.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_a1935cff87bcd9476747bdc06c5b1077.json
new file mode 100644
index 0000000000..e306aedc0f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_a1935cff87bcd9476747bdc06c5b1077.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"
World
\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_TBkiL8JC9r1UUFPaVruQIqwO\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"delete\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA4RJQCdYY8SKLeEZb5KqeSqIh6\",\"object\":\"chat.completion.chunk\",\"created\":1743022872,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_07b696e04ff4ad79aff112f40827860a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_07b696e04ff4ad79aff112f40827860a.json
new file mode 100644
index 0000000000..13b9e5b4c9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_07b696e04ff4ad79aff112f40827860a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-7b4e2ce6-f2c9-475c-b4c0-d5419393cc4f\",\"object\":\"chat.completion\",\"created\":1743024151,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_rbkp\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"\\u003cp\\u003eTest\\u003c/p\\u003e\\\"]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.101187522,\"prompt_tokens\":510,\"prompt_time\":0.060713384,\"completion_tokens\":32,\"completion_time\":0.116363636,\"total_tokens\":542,\"total_time\":0.17707702},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5bpxwerss6gp4y28vdn8k\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_c17ddd8d44c361ab298d23eb75e765e8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_c17ddd8d44c361ab298d23eb75e765e8.json
new file mode 100644
index 0000000000..35083a97f1
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_c17ddd8d44c361ab298d23eb75e765e8.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-d6f139a9-0f11-4020-9f79-3d767aece32c\",\"object\":\"chat.completion\",\"created\":1742851857,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_n24k\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"position\\\": \\\"after\\\", \\\"blocks\\\": [\\\"\\u003cp\\u003eTest\\u003c/p\\u003e\\\"]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":2.8626354440000004,\"prompt_tokens\":519,\"prompt_time\":0.06258531,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":558,\"total_time\":0.204403492},\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01jq511m9cfnx8505dat0nf8gn\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_0e18dea26a8da29261df12717e3377dc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_0e18dea26a8da29261df12717e3377dc.json
new file mode 100644
index 0000000000..8b592327b5
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_0e18dea26a8da29261df12717e3377dc.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-689ee989-521e-4686-b4a2-df436bbb70ae\",\"object\":\"chat.completion\",\"created\":1743024151,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_bqby\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"position\\\": \\\"before\\\", \\\"blocks\\\": [\\\"\\u003cp\\u003eTest\\u003c/p\\u003e\\\"]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":1.04447738,\"prompt_tokens\":509,\"prompt_time\":0.064356871,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":548,\"total_time\":0.206175053},\"system_fingerprint\":\"fp_fcc3b74982\",\"x_groq\":{\"id\":\"req_01jqa5bnmzers8atvt0adjzenm\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_b1c8e1ca2c7aab796f706d11df880925.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_b1c8e1ca2c7aab796f706d11df880925.json
new file mode 100644
index 0000000000..3196b882ca
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_b1c8e1ca2c7aab796f706d11df880925.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-fda6bd35-d9a9-48ec-9bdb-7d5c474d7135\",\"object\":\"chat.completion\",\"created\":1742851854,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_qbeq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"\\u003cp\\u003eTest\\u003c/p\\u003e\\\"]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.129595027,\"prompt_tokens\":518,\"prompt_time\":0.069198015,\"completion_tokens\":32,\"completion_time\":0.116363636,\"total_tokens\":550,\"total_time\":0.185561651},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq511ky5fnxaeqvra8r8n9k6\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_4ce3cb18c690bfc894b44fbfdf837ab9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_4ce3cb18c690bfc894b44fbfdf837ab9.json
new file mode 100644
index 0000000000..ec5aa1846a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_4ce3cb18c690bfc894b44fbfdf837ab9.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-c87c7057-7f98-4342-892d-16d21e8a593c\",\"object\":\"chat.completion.chunk\",\"created\":1742851817,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510fghfen9aa7hzgr4f5eb\"}}\n\ndata: {\"id\":\"chatcmpl-c87c7057-7f98-4342-892d-16d21e8a593c\",\"object\":\"chat.completion.chunk\",\"created\":1742851817,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_d3m4\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"\\u003cp\\u003eTest\\u003c/p\\u003e\\\"]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c87c7057-7f98-4342-892d-16d21e8a593c\",\"object\":\"chat.completion.chunk\",\"created\":1742851817,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510fghfen9aa7hzgr4f5eb\",\"usage\":{\"queue_time\":0.108187697,\"prompt_tokens\":519,\"prompt_time\":0.033743533,\"completion_tokens\":32,\"completion_time\":0.116363636,\"total_tokens\":551,\"total_time\":0.150107169}}}\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/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_d8ad01cba0f511aa9c17641f39e3525b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_d8ad01cba0f511aa9c17641f39e3525b.json
new file mode 100644
index 0000000000..4d310c207c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_d8ad01cba0f511aa9c17641f39e3525b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-0b81cdae-3d23-4e00-a4c6-906dbff8c104\",\"object\":\"chat.completion.chunk\",\"created\":1743024130,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5b0d3fctv22e3x9j1spjz\"}}\n\ndata: {\"id\":\"chatcmpl-0b81cdae-3d23-4e00-a4c6-906dbff8c104\",\"object\":\"chat.completion.chunk\",\"created\":1743024130,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_96q0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"position\\\": \\\"after\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"blocks\\\": [\\\"\\u003cp\\u003eTest\\u003c/p\\u003e\\\"]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-0b81cdae-3d23-4e00-a4c6-906dbff8c104\",\"object\":\"chat.completion.chunk\",\"created\":1743024130,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5b0d3fctv22e3x9j1spjz\",\"usage\":{\"queue_time\":1.7427066919999998,\"prompt_tokens\":510,\"prompt_time\":0.065127187,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":549,\"total_time\":0.206945369}}}\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/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_87610c6236ac01f29007a4451bfae630.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_87610c6236ac01f29007a4451bfae630.json
new file mode 100644
index 0000000000..e5d6fb5fb6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_87610c6236ac01f29007a4451bfae630.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-a6e0017f-6eb0-4bcd-8423-f324c9435833\",\"object\":\"chat.completion.chunk\",\"created\":1742851816,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510f6cexp83yaa6d5frmc7\"}}\n\ndata: {\"id\":\"chatcmpl-a6e0017f-6eb0-4bcd-8423-f324c9435833\",\"object\":\"chat.completion.chunk\",\"created\":1742851816,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_adym\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"\\u003cp\\u003eTest\\u003c/p\\u003e\\\"]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a6e0017f-6eb0-4bcd-8423-f324c9435833\",\"object\":\"chat.completion.chunk\",\"created\":1742851816,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510f6cexp83yaa6d5frmc7\",\"usage\":{\"queue_time\":0.108456576,\"prompt_tokens\":518,\"prompt_time\":0.033584484,\"completion_tokens\":32,\"completion_time\":0.116363636,\"total_tokens\":550,\"total_time\":0.14994812}}}\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/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_9acdba716ae38965e3abcd1465c9db58.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_9acdba716ae38965e3abcd1465c9db58.json
new file mode 100644
index 0000000000..f9cf144423
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_9acdba716ae38965e3abcd1465c9db58.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-f14da915-9d45-409d-bcac-c9de572e2604\",\"object\":\"chat.completion.chunk\",\"created\":1743024128,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5b005ergteh6v2f1dzyzn\"}}\n\ndata: {\"id\":\"chatcmpl-f14da915-9d45-409d-bcac-c9de572e2604\",\"object\":\"chat.completion.chunk\",\"created\":1743024128,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_0ybx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"position\\\": \\\"before\\\", \\\"blocks\\\": [\\\"\\u003cp\\u003eTest\\u003c/p\\u003e\\\"]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f14da915-9d45-409d-bcac-c9de572e2604\",\"object\":\"chat.completion.chunk\",\"created\":1743024128,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5b005ergteh6v2f1dzyzn\",\"usage\":{\"queue_time\":0.098299461,\"prompt_tokens\":509,\"prompt_time\":0.073251341,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":548,\"total_time\":0.215069523}}}\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/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_4c60c32b45648bafb25f563f4a596e49.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_4c60c32b45648bafb25f563f4a596e49.json
new file mode 100644
index 0000000000..dd7eb90990
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_4c60c32b45648bafb25f563f4a596e49.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjetj3UWmgUXG7YFpaONMNvIXE4R\",\n \"object\": \"chat.completion\",\n \"created\": 1742851803,\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_QaTXWAVe5F5kYeNcgDOmdTQ3\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
Test
\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 226,\n \"completion_tokens\": 31,\n \"total_tokens\": 257,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_64cc15fa8dfb103bb68d5d0fda4bc7fe.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_64cc15fa8dfb103bb68d5d0fda4bc7fe.json
new file mode 100644
index 0000000000..be6207c566
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_64cc15fa8dfb103bb68d5d0fda4bc7fe.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSUB0fmqtaUVboG9dtJDaTxW974P\",\n \"object\": \"chat.completion\",\n \"created\": 1743024119,\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_qs1EYvmYKECK1PNv3cgwgllj\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
Test
\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 217,\n \"completion_tokens\": 31,\n \"total_tokens\": 248,\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_6bb567654c\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_adcd6032dec2507a8cda96ed693827ba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_adcd6032dec2507a8cda96ed693827ba.json
new file mode 100644
index 0000000000..76906f41f3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_adcd6032dec2507a8cda96ed693827ba.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first paragraph\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BUXzzg8oE1TBLDHDlwXetuUBUO3dV\",\n \"object\": \"chat.completion\",\n \"created\": 1746620231,\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_E1W4Is3CREbiLGD8y1Yp7Osj\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
Test
\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 428,\n \"completion_tokens\": 31,\n \"total_tokens\": 459,\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_90122d973c\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_30cf2fe95ca8a189687d0e4d19ceb46b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_30cf2fe95ca8a189687d0e4d19ceb46b.json
new file mode 100644
index 0000000000..721687466d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_30cf2fe95ca8a189687d0e4d19ceb46b.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BUVzKbw7fO1j6pq1hITDhTcccVFMD\",\n \"object\": \"chat.completion\",\n \"created\": 1746612502,\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_cglHMUxkSVaiERleNmTw4VhE\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"
Test
\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 427,\n \"completion_tokens\": 31,\n \"total_tokens\": 458,\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_90122d973c\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_49602668af275e790a24387e69e98eed.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_49602668af275e790a24387e69e98eed.json
new file mode 100644
index 0000000000..0a2aedf968
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_49602668af275e790a24387e69e98eed.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSUA6bhE3XvnoWym9aZ0tbJfrdKE\",\n \"object\": \"chat.completion\",\n \"created\": 1743024118,\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_OVv34zRMCxdpBcOTxsX2seDQ\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"
Test
\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 216,\n \"completion_tokens\": 31,\n \"total_tokens\": 247,\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_6bb567654c\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_f4b8b28f74c8f7b790f2d091d6e07f31.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_f4b8b28f74c8f7b790f2d091d6e07f31.json
new file mode 100644
index 0000000000..c64430e0f7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_f4b8b28f74c8f7b790f2d091d6e07f31.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjesfvoYs1WoK67b3q8yfy8er7qR\",\n \"object\": \"chat.completion\",\n \"created\": 1742851802,\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_P7c3apMOXe93kXx7npE75DaG\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"
Test
\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 225,\n \"completion_tokens\": 31,\n \"total_tokens\": 256,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_0b08f2fe4043b9cc04d39b3450e4643a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_0b08f2fe4043b9cc04d39b3450e4643a.json
new file mode 100644
index 0000000000..cec4b16712
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_0b08f2fe4043b9cc04d39b3450e4643a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_6XWSknZjNW6FwX2vcbcnDXDj\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA8WB1PKeKC9hCtklEtTIKODHv2\",\"object\":\"chat.completion.chunk\",\"created\":1743022876,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_3277167fb12d5203fb9f4cb16242c9ad.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_3277167fb12d5203fb9f4cb16242c9ad.json
new file mode 100644
index 0000000000..99573acd83
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_3277167fb12d5203fb9f4cb16242c9ad.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first paragraph\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_3YHaFCGY8iueesaOqpW0LBUI\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUlkjL3UraltW5DhQhyXHNddpwk2\",\"object\":\"chat.completion.chunk\",\"created\":1746607816,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_0367933d1b21d67d587cba5c038b7133.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_0367933d1b21d67d587cba5c038b7133.json
new file mode 100644
index 0000000000..878865dfba
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_0367933d1b21d67d587cba5c038b7133.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_0M1IdFcuFSkiVi10uZ2Pk4Is\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BUUljfDa48uRKY8aw0s3Ukq0rSiUc\",\"object\":\"chat.completion.chunk\",\"created\":1746607815,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_90122d973c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_9eda2352f3d5bd1c22f59d000d43f7ac.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_9eda2352f3d5bd1c22f59d000d43f7ac.json
new file mode 100644
index 0000000000..b8b295a623
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_9eda2352f3d5bd1c22f59d000d43f7ac.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"
Hello
\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_zr3boPkzOZp7cy910DlFGP6P\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSA6gZ3QzgShbbf8aTX6PACd2cOC\",\"object\":\"chat.completion.chunk\",\"created\":1743022874,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link and change text within mark_1_6986df1ce276fc3d96f221d8425d9b18.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link and change text within mark_1_6986df1ce276fc3d96f221d8425d9b18.json
new file mode 100644
index 0000000000..f8e8ea6ebe
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link and change text within mark_1_6986df1ce276fc3d96f221d8425d9b18.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"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\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-4f78b310d1894a48baeb349ddb4e2506\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-f541e30a364b4fdda800f435f28adf28\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"
Hi, world! Bold the text. Link.
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635635,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":37,\"prompt_tokens\":1025,\"total_tokens\":1062,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link_1_6a69205310653d1d7f5c87d37b81c33e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link_1_6a69205310653d1d7f5c87d37b81c33e.json
new file mode 100644
index 0000000000..071cb14324
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link_1_6a69205310653d1d7f5c87d37b81c33e.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"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\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-e05e2b296a924d27bb816bfb06ce3651\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-00d162fd4056413bbd55cdaf19d94df0\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"
Hello, world! Bold text. Link.
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635633,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":35,\"prompt_tokens\":1019,\"total_tokens\":1054,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/plain source block, add mention_1_4d74eb2d8b0c605a2894c40c6e4b9e61.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/plain source block, add mention_1_4d74eb2d8b0c605a2894c40c6e4b9e61.json
new file mode 100644
index 0000000000..94730376bc
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/plain source block, add mention_1_4d74eb2d8b0c605a2894c40c6e4b9e61.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"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)\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-7c0ff6a6c40a4c3c89c9c0d4b9ef1f06\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-1a5dd67c46404a51b1b68786767a2621\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Hello, @Jane Doe!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635628,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":50,\"prompt_tokens\":1017,\"total_tokens\":1067,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove column_1_865190f2994483fe18e577bd57ebfb19.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove column_1_865190f2994483fe18e577bd57ebfb19.json
new file mode 100644
index 0000000000..8c21014721
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove column_1_865190f2994483fe18e577bd57ebfb19.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the second column\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-a720f448df404a109e1e791f1aa76b4c\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-bb50034541304f798a300e4ddc9da663\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Table Cell 1
Table Cell 3
Table Cell 4
Table Cell 6
Table Cell 7
Table Cell 9
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635648,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":159,\"prompt_tokens\":1086,\"total_tokens\":1245,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove last column_1_e1f64ef8803ed9c01dc307ffaa4f401d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove last column_1_e1f64ef8803ed9c01dc307ffaa4f401d.json
new file mode 100644
index 0000000000..c9b5cc4ba2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove last column_1_e1f64ef8803ed9c01dc307ffaa4f401d.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the last column\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-6fcd73144f834655be31a46b4c912eef\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-8c0b1a21729e42c9ae14ff31f9e20bfd\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Table Cell 1
Table Cell 2
Table Cell 4
Table Cell Bold 5
Table Cell 7
Table Cell 8
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635653,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":164,\"prompt_tokens\":1086,\"total_tokens\":1250,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove last row_1_19268fc09b78ab13b0b4398695a6b6fc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove last row_1_19268fc09b78ab13b0b4398695a6b6fc.json
new file mode 100644
index 0000000000..b178679aca
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/remove last row_1_19268fc09b78ab13b0b4398695a6b6fc.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the last row\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-9d74dbe65f4945499d27d2b00564b9af\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-ba2a3cef80774502bcdbc1cacab5955d\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the second row\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-b86ee4a4c4e747019aded1d528c069ae\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-4f9aad96e1cd4937b1249363f9c8e227\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"ref1$\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635658,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":19,\"prompt_tokens\":1086,\"total_tokens\":1105,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_ce75f42dbd714e633119967ab1ffdf6e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_ce75f42dbd714e633119967ab1ffdf6e.json
new file mode 100644
index 0000000000..9dab445142
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_ce75f42dbd714e633119967ab1ffdf6e.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-6b2263c7befd44ffbcdc30e763a5c724\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-06d57f84c69d492da8be4c73ddaefcd7\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Hallo, Welt!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746620356,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":31,\"prompt_tokens\":1008,\"total_tokens\":1039,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mark_1_e3b912385d3f9835d857297ea64870d2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mark_1_e3b912385d3f9835d857297ea64870d2.json
new file mode 100644
index 0000000000..d24bdbf76c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mark_1_e3b912385d3f9835d857297ea64870d2.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-7c7fe5967cdc443794f52d5bdf03e7d0\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-5145376696bd486d9aac799935156ef8\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"
Hello, @John Doe! How I'm feeling blue!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635621,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":57,\"prompt_tokens\":1010,\"total_tokens\":1067,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mention_1_5a61369cbb49bd2b6aa29478e96b532e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mention_1_5a61369cbb49bd2b6aa29478e96b532e.json
new file mode 100644
index 0000000000..9370e28528
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mention_1_5a61369cbb49bd2b6aa29478e96b532e.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? I'm feeling blue!' (remove mention but keep bold 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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-9a32ded753b34819ba412ba844fe6ea3\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-9657a51c4b1b4483800603bd1adbf27d\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"
Hello! How are you doing? I\\\\u0027m feeling blue!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635623,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":56,\"prompt_tokens\":1026,\"total_tokens\":1082,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, replace content_1_a39e80503bfad51d70acc9fa72daf1ef.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, replace content_1_a39e80503bfad51d70acc9fa72daf1ef.json
new file mode 100644
index 0000000000..500f100f9c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, replace content_1_a39e80503bfad51d70acc9fa72daf1ef.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"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'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-f3b67d567e7c4b9d8e403e6c9c08509e\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-3b49e2e990734bff95c124eb5a5d2cdd\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"
Hello, updated content
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635615,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":31,\"prompt_tokens\":1016,\"total_tokens\":1047,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, update mention prop_1_958b466e7d8fe0f3edabd4cb3e5285bf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, update mention prop_1_958b466e7d8fe0f3edabd4cb3e5285bf.json
new file mode 100644
index 0000000000..3331961290
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, update mention prop_1_958b466e7d8fe0f3edabd4cb3e5285bf.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-5f5c17e4ddff4c53a9555c68eaf2db13\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-20b9c349e6e342159c234a5239c55a2b\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"
Hello, @Jane Doe! How are you doing? I'm feeling blue!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635630,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":75,\"prompt_tokens\":1008,\"total_tokens\":1083,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, update text_1_1891ec4fc1215325524abc13d09de134.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, update text_1_1891ec4fc1215325524abc13d09de134.json
new file mode 100644
index 0000000000..39c65b65ba
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, update text_1_1891ec4fc1215325524abc13d09de134.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block to german\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-88c06128f65449dc8a644aa3bf1cad62\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-6c08c7807d704805aacd809e25d1e1b7\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"
Hallo, @John Doe! Wie geht es dir? Ich f\\\\u00fchle mich blau!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635617,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":83,\"prompt_tokens\":1008,\"total_tokens\":1091,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_4cdaf42f33ea819394b0ca0d1d908263.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_4cdaf42f33ea819394b0ca0d1d908263.json
new file mode 100644
index 0000000000..9837acd417
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_4cdaf42f33ea819394b0ca0d1d908263.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-26822b06aba14c5a8dd33ff9ab771dfb\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-22e3713603fc4655a5b233c2667620c5\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Hello, world!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635627,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":34,\"prompt_tokens\":1006,\"total_tokens\":1040,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark (word)_1_6a7a4dc6ecabe89b67efe28cc4dc784a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark (word)_1_6a7a4dc6ecabe89b67efe28cc4dc784a.json
new file mode 100644
index 0000000000..60b9b6c254
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark (word)_1_6a7a4dc6ecabe89b67efe28cc4dc784a.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-9f6879cde3e1445b99a77d8619bb0888\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-48beb23d02054f63bb592e2083e83469\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Hello, world!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635626,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":30,\"prompt_tokens\":1013,\"total_tokens\":1043,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block prop and content_1_f6267f5c3443323a2f40fa0d072c1b5e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block prop and content_1_f6267f5c3443323a2f40fa0d072c1b5e.json
new file mode 100644
index 0000000000..b3dbb2ce41
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block prop and content_1_f6267f5c3443323a2f40fa0d072c1b5e.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"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!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-804b98a4a2674608a62d7e97be320a02\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-0b83c850d9204258bd3f9e6691e3d2bc\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
What\\\\u2019s up, world!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635613,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":42,\"prompt_tokens\":1020,\"total_tokens\":1062,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block prop_1_19381acfdf7cd38af6ff1f49832f333c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block prop_1_19381acfdf7cd38af6ff1f49832f333c.json
new file mode 100644
index 0000000000..cda9557979
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block prop_1_19381acfdf7cd38af6ff1f49832f333c.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-d4fa26d748834bc9a3793c26b4aa4787\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-188560702b3640a8a8b1b934c609d0f6\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Hello, world!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635610,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":37,\"prompt_tokens\":1008,\"total_tokens\":1045,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type and content_1_39dfc9dc232283469d3dab4d9add48a7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type and content_1_39dfc9dc232283469d3dab4d9add48a7.json
new file mode 100644
index 0000000000..e9c80e674b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type and content_1_39dfc9dc232283469d3dab4d9add48a7.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"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!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-77f2bb08e1ab45a68abe2c913a818225\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-fa9c8d6370d24c7391359863a47ee3ba\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
What's up, world!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635611,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":35,\"prompt_tokens\":1020,\"total_tokens\":1055,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_d3cb3ecb84f401197a72cf92a49d9d50.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_d3cb3ecb84f401197a72cf92a49d9d50.json
new file mode 100644
index 0000000000..1df2c6c57a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_d3cb3ecb84f401197a72cf92a49d9d50.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-d435bf57c4a147f1a87455f5d99928c0\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-db48a3b59d5e4a8fa7511af68897e2f7\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Hello, world!
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635608,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":32,\"prompt_tokens\":1008,\"total_tokens\":1040,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update table cell_1_3bf71541d64e8ad11a8560263e487872.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update table cell_1_3bf71541d64e8ad11a8560263e487872.json
new file mode 100644
index 0000000000..dfe9bc15e9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update table cell_1_3bf71541d64e8ad11a8560263e487872.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the first cell to 'Hello, world!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-cac6b9fe9c11482a9b7be87f6a6c9dbe\",\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"content\":\"\",\"refusal\":null,\"role\":\"assistant\",\"audio\":null,\"function_call\":null,\"tool_calls\":[{\"id\":\"chatcmpl-tool-0ec749ba64684304a44d5d449b14cfe4\",\"function\":{\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"
Hello, world!
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"}]}\",\"name\":\"json\"},\"type\":\"function\"}],\"reasoning_content\":null},\"stop_reason\":null}],\"created\":1746635638,\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"object\":\"chat.completion\",\"service_tier\":null,\"system_fingerprint\":null,\"usage\":{\"completion_tokens\":222,\"prompt_tokens\":1092,\"total_tokens\":1314,\"completion_tokens_details\":null,\"prompt_tokens_details\":null},\"search_results\":[],\"prompt_logprobs\":null}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_0d3497ef63e162e6c990f21fa3446a93.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_0d3497ef63e162e6c990f21fa3446a93.json
new file mode 100644
index 0000000000..d93cf22bf9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_0d3497ef63e162e6c990f21fa3446a93.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-ea203ccf-ef51-4461-bc8d-364d511068e8\",\"object\":\"chat.completion\",\"created\":1742851853,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_4d1p\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHi, world! Bold the text. Link.\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.567523843,\"prompt_tokens\":631,\"prompt_time\":0.033388691,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":670,\"total_time\":0.175206873},\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01jq511jrpffgt38da6k50sprj\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_8ce773c9f905dc41987f2c62433559b4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_8ce773c9f905dc41987f2c62433559b4.json
new file mode 100644
index 0000000000..e869d32452
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_8ce773c9f905dc41987f2c62433559b4.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-1c03913a-6111-49ae-89be-a0c33146cf95\",\"object\":\"chat.completion\",\"created\":1743024149,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_rqaw\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHi, world! Bold the text. Link.\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.101183308,\"prompt_tokens\":622,\"prompt_time\":0.047015956,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":661,\"total_time\":0.188834138},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5bn0eerrvjeheeh2tyxfa\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_ba0e6b49286fbfdb4fe21f0c9af2dfd7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_ba0e6b49286fbfdb4fe21f0c9af2dfd7.json
new file mode 100644
index 0000000000..4fc8992b6b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_ba0e6b49286fbfdb4fe21f0c9af2dfd7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-62f65315-f608-4263-b342-9a68f04755de\",\"object\":\"chat.completion\",\"created\":1742851852,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_tqrd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, world! Bold text. Link.\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.129831781,\"prompt_tokens\":625,\"prompt_time\":0.043600483,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":662,\"total_time\":0.178145938},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq511jdcffgsqf2gr2048ejn\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_c1b51b0594524e19d7018cd935672772.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_c1b51b0594524e19d7018cd935672772.json
new file mode 100644
index 0000000000..117facce76
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_c1b51b0594524e19d7018cd935672772.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-0fddddbf-4a88-4ea5-b640-d218fd3bc5a9\",\"object\":\"chat.completion\",\"created\":1743024149,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_h329\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, world! Bold text. Link.\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":2.1208893829999997,\"prompt_tokens\":616,\"prompt_time\":0.071851935,\"completion_tokens\":38,\"completion_time\":0.138181818,\"total_tokens\":654,\"total_time\":0.210033753},\"system_fingerprint\":\"fp_3884478861\",\"x_groq\":{\"id\":\"req_01jqa5bjmkfne9czh418pwc98x\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_d5e225f64cb2fb656b5e907e97d33ce6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_d5e225f64cb2fb656b5e907e97d33ce6.json
new file mode 100644
index 0000000000..3266270af8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_d5e225f64cb2fb656b5e907e97d33ce6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-684bae2a-9505-41ad-b82e-c9fc148552de\",\"object\":\"chat.completion\",\"created\":1743024146,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_dmym\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\u003e@Jane Doe\\u003c/span\\u003e!\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":2.402523451,\"prompt_tokens\":614,\"prompt_time\":0.082422625,\"completion_tokens\":52,\"completion_time\":0.189090909,\"total_tokens\":666,\"total_time\":0.271513534},\"system_fingerprint\":\"fp_fcc3b74982\",\"x_groq\":{\"id\":\"req_01jqa5bfhpfnc8y2g2c3823wa4\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_ee0f9a24612ffc600b347ddb609702d2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_ee0f9a24612ffc600b347ddb609702d2.json
new file mode 100644
index 0000000000..29facd2199
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_ee0f9a24612ffc600b347ddb609702d2.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-e9e675c5-9341-4b45-917c-d95d12d7d8eb\",\"object\":\"chat.completion\",\"created\":1742851851,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_r6n6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\u003e@Jane Doe\\u003c/span\\u003e!\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.12935644799999998,\"prompt_tokens\":623,\"prompt_time\":0.029359922,\"completion_tokens\":48,\"completion_time\":0.175466778,\"total_tokens\":671,\"total_time\":0.2048267},\"system_fingerprint\":\"fp_72a5dc99ee\",\"x_groq\":{\"id\":\"req_01jq511ha1ffdtmnmhmftprfr2\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_5e65ca44eeb80e5b516c70359b565e9a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_5e65ca44eeb80e5b516c70359b565e9a.json
new file mode 100644
index 0000000000..b9a5bce587
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_5e65ca44eeb80e5b516c70359b565e9a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-f7fad164-13a4-4ea9-b708-347e24655e45\",\"object\":\"chat.completion\",\"created\":1743024134,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_n92t\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, updated content\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.101564991,\"prompt_tokens\":613,\"prompt_time\":0.046509763,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":646,\"total_time\":0.166509763},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5b67xfcxreat4yj5r1qyr\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_6dedcbddb3318c720d7ef034c52888dd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_6dedcbddb3318c720d7ef034c52888dd.json
new file mode 100644
index 0000000000..3371189cc2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_6dedcbddb3318c720d7ef034c52888dd.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-07cacca6-7dfa-4ce5-bdff-a738abb21380\",\"object\":\"chat.completion\",\"created\":1742851846,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_837j\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, updated content\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09621885999999999,\"prompt_tokens\":622,\"prompt_time\":0.031142306,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":655,\"total_time\":0.151142306},\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jq511cftff8rfv6a64g0wb7h\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_0d74d55ba813fae06482dc0f40b0e673.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_0d74d55ba813fae06482dc0f40b0e673.json
new file mode 100644
index 0000000000..81f2802b58
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_0d74d55ba813fae06482dc0f40b0e673.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-4d48da49-fc60-4970-9aef-8aec8bb127ac\",\"object\":\"chat.completion\",\"created\":1742851850,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_kn42\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\u003e@John Doe\\u003c/span\\u003e! How are you doing?\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.11324404199999999,\"prompt_tokens\":616,\"prompt_time\":0.043829372,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":673,\"total_time\":0.251102099},\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jq511fz6ffcvvqdzedz83hbc\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ee8369720858715a73cea67556feb424.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ee8369720858715a73cea67556feb424.json
new file mode 100644
index 0000000000..888f41b717
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ee8369720858715a73cea67556feb424.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-24d90be3-130d-4258-8dfc-4fb87e969a3d\",\"object\":\"chat.completion\",\"created\":1743024142,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_m81s\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\u003e@John Doe\\u003c/span\\u003e! How are you doing?\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":2.774518607,\"prompt_tokens\":607,\"prompt_time\":0.081647483,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":664,\"total_time\":0.28892021},\"system_fingerprint\":\"fp_4e32347616\",\"x_groq\":{\"id\":\"req_01jqa5bbt3erp9b8jtqvepc6mr\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_17d6fb5d956b5cf88555a44186ffb8e8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_17d6fb5d956b5cf88555a44186ffb8e8.json
new file mode 100644
index 0000000000..1e20f0d386
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_17d6fb5d956b5cf88555a44186ffb8e8.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-d81c2222-b030-4223-ad52-2a9fd909ffe7\",\"object\":\"chat.completion\",\"created\":1742851850,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_qdg3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello! How \\u003cstrong\\u003eare you doing?\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.32960613800000005,\"prompt_tokens\":627,\"prompt_time\":0.046095052,\"completion_tokens\":40,\"completion_time\":0.145454545,\"total_tokens\":667,\"total_time\":0.191549597},\"system_fingerprint\":\"fp_6507bcfb6f\",\"x_groq\":{\"id\":\"req_01jq511gcfeymavm17qkcgf66v\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_48c55488f9f0cac39cce89a41a5c8d67.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_48c55488f9f0cac39cce89a41a5c8d67.json
new file mode 100644
index 0000000000..039bf63abe
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_48c55488f9f0cac39cce89a41a5c8d67.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-23a482e2-98e3-4fe0-bc12-b08565fe76d3\",\"object\":\"chat.completion\",\"created\":1743024143,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_1nqd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello! How \\u003cstrong\\u003eare you doing?\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10054377,\"prompt_tokens\":618,\"prompt_time\":0.049877689,\"completion_tokens\":40,\"completion_time\":0.145454545,\"total_tokens\":658,\"total_time\":0.195332234},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5bev5fd38wm90zzamap84\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_1e0ef9b5e4113fe3f81ade80fe113101.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_1e0ef9b5e4113fe3f81ade80fe113101.json
new file mode 100644
index 0000000000..9668c3273c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_1e0ef9b5e4113fe3f81ade80fe113101.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-1900a760-3dee-4f2d-8498-492d517be568\",\"object\":\"chat.completion\",\"created\":1743024146,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_1hwa\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\u003e@Jane Doe\\u003c/span\\u003e! How \\u003cstrong\\u003eare you doing?\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.101197116,\"prompt_tokens\":605,\"prompt_time\":0.043640058,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":667,\"total_time\":0.269094603},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5bj7rfne9rb8033n286bn\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_d6586acadb1a74c780be2b96fd3492f5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_d6586acadb1a74c780be2b96fd3492f5.json
new file mode 100644
index 0000000000..2a847c4eb4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_d6586acadb1a74c780be2b96fd3492f5.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-7cf36a7a-cdc6-4676-aca6-afa32f828354\",\"object\":\"chat.completion\",\"created\":1742851852,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_623d\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\u003e@Jane Doe\\u003c/span\\u003e! How \\u003cstrong\\u003eare you doing?\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.406345857,\"prompt_tokens\":614,\"prompt_time\":0.040076335,\"completion_tokens\":62,\"completion_time\":0.225871898,\"total_tokens\":676,\"total_time\":0.265948233},\"system_fingerprint\":\"fp_72a5dc99ee\",\"x_groq\":{\"id\":\"req_01jq511hprffe8pwp1r9pcjm39\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_0563f6ee573b13713a782235a10f8a10.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_0563f6ee573b13713a782235a10f8a10.json
new file mode 100644
index 0000000000..0662ceed22
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_0563f6ee573b13713a782235a10f8a10.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-738faa0d-039e-4a6d-a387-fd21012c67fe\",\"object\":\"chat.completion\",\"created\":1743024139,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_cz9z\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, updated content\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":2.138724659,\"prompt_tokens\":613,\"prompt_time\":0.068872821,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":646,\"total_time\":0.188872821},\"system_fingerprint\":\"fp_4e32347616\",\"x_groq\":{\"id\":\"req_01jqa5b9dbermvr675e565btk0\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_265d54ec264829af015886bd1a1eaa36.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_265d54ec264829af015886bd1a1eaa36.json
new file mode 100644
index 0000000000..a45ce4bca6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_265d54ec264829af015886bd1a1eaa36.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-0270477d-3244-4c5c-90d4-639a9f31965a\",\"object\":\"chat.completion\",\"created\":1742851850,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_ab14\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, updated content\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.254277826,\"prompt_tokens\":622,\"prompt_time\":0.033749988,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":655,\"total_time\":0.153749988},\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jq511fgnffcsw9nh7kw5b84y\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_a4351af5ac94eb0f2966b9b95829b07a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_a4351af5ac94eb0f2966b9b95829b07a.json
new file mode 100644
index 0000000000..b8bf12d450
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_a4351af5ac94eb0f2966b9b95829b07a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-1d4da6a7-a66d-4dd9-a240-195ebe42ccba\",\"object\":\"chat.completion\",\"created\":1742851851,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_51kx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cstrong\\u003eworld!\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09117622300000001,\"prompt_tokens\":619,\"prompt_time\":0.036205478,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":656,\"total_time\":0.170750933},\"system_fingerprint\":\"fp_72a5dc99ee\",\"x_groq\":{\"id\":\"req_01jq511gy6eynahjrdr0czz41t\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_b20ef9988bd40479f69845ac62408414.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_b20ef9988bd40479f69845ac62408414.json
new file mode 100644
index 0000000000..d402070211
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_b20ef9988bd40479f69845ac62408414.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-fd607ce7-80fc-459a-81e2-287367ced16f\",\"object\":\"chat.completion\",\"created\":1743024143,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_9cfp\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cstrong\\u003eworld!\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09991100299999998,\"prompt_tokens\":610,\"prompt_time\":0.069304084,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":647,\"total_time\":0.203849539},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5bf5pfncarpjmt7r03dkh\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_15643c1543bd8a92f3b544ad08d97f71.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_15643c1543bd8a92f3b544ad08d97f71.json
new file mode 100644
index 0000000000..b483e785c2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_15643c1543bd8a92f3b544ad08d97f71.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-f8c851d4-6ff2-4c80-8ba2-131dd16431cc\",\"object\":\"chat.completion\",\"created\":1743024137,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_v5qj\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\u003eWhat's up, world!\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10110392700000001,\"prompt_tokens\":617,\"prompt_time\":0.039921708,\"completion_tokens\":41,\"completion_time\":0.149090909,\"total_tokens\":658,\"total_time\":0.189012617},\"system_fingerprint\":\"fp_8dd9fca28c\",\"x_groq\":{\"id\":\"req_01jqa5b919fcybtz3dxpzata0k\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_19540c2aa6a12d64802f0dfb0185b8c1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_19540c2aa6a12d64802f0dfb0185b8c1.json
new file mode 100644
index 0000000000..02bf1fb2bf
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_19540c2aa6a12d64802f0dfb0185b8c1.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-b52f7b61-856c-4853-8c28-a1758edbae8d\",\"object\":\"chat.completion\",\"created\":1742851849,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_j53n\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\u003eWhat's up, world!\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.372087401,\"prompt_tokens\":626,\"prompt_time\":0.027020627,\"completion_tokens\":41,\"completion_time\":0.149090909,\"total_tokens\":667,\"total_time\":0.176111536},\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jq511ersffcth5ry4e6jzfa6\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_307ec8491b1ef3714a834ac2490bd024.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_307ec8491b1ef3714a834ac2490bd024.json
new file mode 100644
index 0000000000..d413b329e2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_307ec8491b1ef3714a834ac2490bd024.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-e4143855-f212-4a8d-9ae6-ddf083a39b0a\",\"object\":\"chat.completion\",\"created\":1743024135,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_9erk\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\u003eHello, world!\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.101659144,\"prompt_tokens\":605,\"prompt_time\":0.045649355,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":644,\"total_time\":0.187467537},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5b71efn9awps4ny5nak7n\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_ce3c693765bfd9e5728116cc42a6b900.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_ce3c693765bfd9e5728116cc42a6b900.json
new file mode 100644
index 0000000000..301e678947
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_ce3c693765bfd9e5728116cc42a6b900.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-20cf6ee1-6ab1-404d-90ff-3362d9356b20\",\"object\":\"chat.completion\",\"created\":1742851848,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_g0xh\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\u003eHello, world!\\u003c/p\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.663263383,\"prompt_tokens\":614,\"prompt_time\":0.071571575,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":653,\"total_time\":0.213389757},\"system_fingerprint\":\"fp_3884478861\",\"x_groq\":{\"id\":\"req_01jq511dcgffaatxwwmbf06nfc\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_45f4cc6720855b63fa9b5d1c504fa6b3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_45f4cc6720855b63fa9b5d1c504fa6b3.json
new file mode 100644
index 0000000000..3ad2ebae3a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_45f4cc6720855b63fa9b5d1c504fa6b3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-bb50db0e-633d-4691-889e-ee7f31a792d9\",\"object\":\"chat.completion\",\"created\":1742851848,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_v1yr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003ch1\\u003eWhat's up, world!\\u003c/h1\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.132600006,\"prompt_tokens\":626,\"prompt_time\":0.031439802,\"completion_tokens\":37,\"completion_time\":0.135392388,\"total_tokens\":663,\"total_time\":0.16683219},\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jq511ebneyhaygq9kpffymw8\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_4ceadf8d7b20dff47f14cf354e6bb681.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_4ceadf8d7b20dff47f14cf354e6bb681.json
new file mode 100644
index 0000000000..65a9e25b42
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_4ceadf8d7b20dff47f14cf354e6bb681.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-8fc15eb0-9d0a-45dc-a1c5-085b2f93b732\",\"object\":\"chat.completion\",\"created\":1743024136,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_z5fy\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003ch1\\u003eWhat's up, world!\\u003c/h1\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":1.213644212,\"prompt_tokens\":617,\"prompt_time\":0.105761967,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":654,\"total_time\":0.240307422},\"system_fingerprint\":\"fp_fcc3b74982\",\"x_groq\":{\"id\":\"req_01jqa5b7gjfcxthm51fespez24\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_022672941eeb700df2a475c271faf4ea.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_022672941eeb700df2a475c271faf4ea.json
new file mode 100644
index 0000000000..861071b19c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_022672941eeb700df2a475c271faf4ea.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-06b4c4d8-69d0-4462-ab1d-c28ad2f57e08\",\"object\":\"chat.completion\",\"created\":1743024134,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_qcpc\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003ch1\\u003eHello, world!\\u003c/h1\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.100239034,\"prompt_tokens\":605,\"prompt_time\":0.046873197,\"completion_tokens\":34,\"completion_time\":0.123636364,\"total_tokens\":639,\"total_time\":0.170509561},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5b6pyerks00gpsa4h3sat\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_4e62113288cbf0ba07a615f83fc58aa6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_4e62113288cbf0ba07a615f83fc58aa6.json
new file mode 100644
index 0000000000..81c2452769
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_4e62113288cbf0ba07a615f83fc58aa6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-f834f076-b607-42d6-b413-ce72865faa45\",\"object\":\"chat.completion\",\"created\":1742851847,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_156n\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003ch1\\u003eHello, world!\\u003c/h1\\u003e\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.409013711,\"prompt_tokens\":614,\"prompt_time\":0.039249899,\"completion_tokens\":34,\"completion_time\":0.123696088,\"total_tokens\":648,\"total_time\":0.162945987},\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01jq511cs5ff8rf3ryj8y58qjc\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_69a82232be0164c8dcf96fb44e9a8886.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_69a82232be0164c8dcf96fb44e9a8886.json
new file mode 100644
index 0000000000..b96ce37275
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_69a82232be0164c8dcf96fb44e9a8886.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-52d68c83-6ff9-47b6-a933-3f09922f2bef\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5azdxfctvn3cz6qfbk78a\"}}\n\ndata: {\"id\":\"chatcmpl-52d68c83-6ff9-47b6-a933-3f09922f2bef\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_zbf3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHi, world! Bold the text. Link.\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-52d68c83-6ff9-47b6-a933-3f09922f2bef\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5azdxfctvn3cz6qfbk78a\",\"usage\":{\"queue_time\":0.099301261,\"prompt_tokens\":622,\"prompt_time\":0.054383873,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":661,\"total_time\":0.196202055}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_a1c1fd192c8fb01785f8c99fd6b36099.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_a1c1fd192c8fb01785f8c99fd6b36099.json
new file mode 100644
index 0000000000..69dbb033fa
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_a1c1fd192c8fb01785f8c99fd6b36099.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-8294e795-d115-42aa-8a5b-ad665efce963\",\"object\":\"chat.completion.chunk\",\"created\":1742851815,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510dzsexmtny223yty28nm\"}}\n\ndata: {\"id\":\"chatcmpl-8294e795-d115-42aa-8a5b-ad665efce963\",\"object\":\"chat.completion.chunk\",\"created\":1742851815,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_0f42\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHi, world! Bold the text. Link.\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8294e795-d115-42aa-8a5b-ad665efce963\",\"object\":\"chat.completion.chunk\",\"created\":1742851815,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510dzsexmtny223yty28nm\",\"usage\":{\"queue_time\":0.097269721,\"prompt_tokens\":631,\"prompt_time\":0.048785744,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":670,\"total_time\":0.190603926}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_120e261ae44f2501b23df464c1816e1d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_120e261ae44f2501b23df464c1816e1d.json
new file mode 100644
index 0000000000..d9101b6430
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_120e261ae44f2501b23df464c1816e1d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-018e4adf-d65b-4bfa-ae3a-0a23433ad8b9\",\"object\":\"chat.completion.chunk\",\"created\":1742851815,\"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_01jq510dmgfnbs9td5ysyqr25n\"}}\n\ndata: {\"id\":\"chatcmpl-018e4adf-d65b-4bfa-ae3a-0a23433ad8b9\",\"object\":\"chat.completion.chunk\",\"created\":1742851815,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_2hqa\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, world! Bold text. Link.\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-018e4adf-d65b-4bfa-ae3a-0a23433ad8b9\",\"object\":\"chat.completion.chunk\",\"created\":1742851815,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510dmgfnbs9td5ysyqr25n\",\"usage\":{\"queue_time\":0.136847524,\"prompt_tokens\":625,\"prompt_time\":0.02960718,\"completion_tokens\":37,\"completion_time\":0.136445746,\"total_tokens\":662,\"total_time\":0.166052926}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_d76e6284d9647974aafe6b63e61efae1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_d76e6284d9647974aafe6b63e61efae1.json
new file mode 100644
index 0000000000..b02058b45e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_d76e6284d9647974aafe6b63e61efae1.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-22db3b21-6a95-430a-b03e-772a4e0e983e\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5az39erfvgcgw34f6acb2\"}}\n\ndata: {\"id\":\"chatcmpl-22db3b21-6a95-430a-b03e-772a4e0e983e\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_xc6k\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, world! Bold text. Link.\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-22db3b21-6a95-430a-b03e-772a4e0e983e\",\"object\":\"chat.completion.chunk\",\"created\":1743024127,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5az39erfvgcgw34f6acb2\",\"usage\":{\"queue_time\":0.106557634,\"prompt_tokens\":616,\"prompt_time\":0.040156595,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":653,\"total_time\":0.17470205}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_c2db249b95f14e7d3982376670f3c0ae.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_c2db249b95f14e7d3982376670f3c0ae.json
new file mode 100644
index 0000000000..bbf7b5d398
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_c2db249b95f14e7d3982376670f3c0ae.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-da0a3e25-c15b-4df5-a724-31bffae49ff3\",\"object\":\"chat.completion.chunk\",\"created\":1742851814,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510ct7fnavq4rpkkrj3r5x\"}}\n\ndata: {\"id\":\"chatcmpl-da0a3e25-c15b-4df5-a724-31bffae49ff3\",\"object\":\"chat.completion.chunk\",\"created\":1742851814,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_k5cg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\u003e@Jane Doe\\u003c/span\\u003e!\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-da0a3e25-c15b-4df5-a724-31bffae49ff3\",\"object\":\"chat.completion.chunk\",\"created\":1742851814,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510ct7fnavq4rpkkrj3r5x\",\"usage\":{\"queue_time\":0.10127511300000001,\"prompt_tokens\":623,\"prompt_time\":0.040294182,\"completion_tokens\":48,\"completion_time\":0.174545455,\"total_tokens\":671,\"total_time\":0.214839637}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_ef774003cf573ef4870a0998fcebce3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_ef774003cf573ef4870a0998fcebce3b.json
new file mode 100644
index 0000000000..090566f77b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_ef774003cf573ef4870a0998fcebce3b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-660d32af-ea12-4e8e-9cfe-87a818c9529f\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5ayazfctvx1ps0bs8cpc6\"}}\n\ndata: {\"id\":\"chatcmpl-660d32af-ea12-4e8e-9cfe-87a818c9529f\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_kdmm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\u003e@Jane Doe\\u003c/span\\u003e!\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-660d32af-ea12-4e8e-9cfe-87a818c9529f\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5ayazfctvx1ps0bs8cpc6\",\"usage\":{\"queue_time\":0.09991766899999999,\"prompt_tokens\":614,\"prompt_time\":0.039700916,\"completion_tokens\":48,\"completion_time\":0.174545455,\"total_tokens\":662,\"total_time\":0.214246371}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_68e7ca6b2d5999017e04e81283b0c923.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_68e7ca6b2d5999017e04e81283b0c923.json
new file mode 100644
index 0000000000..fa168c198c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_68e7ca6b2d5999017e04e81283b0c923.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-83b449a6-897a-43e0-989b-e98280d68610\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq51086mfn59wffpjft6jth8\"}}\n\ndata: {\"id\":\"chatcmpl-83b449a6-897a-43e0-989b-e98280d68610\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_7wd7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, updated content\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-83b449a6-897a-43e0-989b-e98280d68610\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq51086mfn59wffpjft6jth8\",\"usage\":{\"queue_time\":0.438535067,\"prompt_tokens\":622,\"prompt_time\":0.041519212,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":655,\"total_time\":0.161519212}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_98b3941ade9885f24e2b6c14c34079f4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_98b3941ade9885f24e2b6c14c34079f4.json
new file mode 100644
index 0000000000..e1b4f4e438
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_98b3941ade9885f24e2b6c14c34079f4.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-9148f330-0de4-4882-ba5b-1ecc5fea6337\",\"object\":\"chat.completion.chunk\",\"created\":1743024121,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5asbxerct8z7nbxwbf810\"}}\n\ndata: {\"id\":\"chatcmpl-9148f330-0de4-4882-ba5b-1ecc5fea6337\",\"object\":\"chat.completion.chunk\",\"created\":1743024121,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_jw8w\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, updated content\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-9148f330-0de4-4882-ba5b-1ecc5fea6337\",\"object\":\"chat.completion.chunk\",\"created\":1743024121,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5asbxerct8z7nbxwbf810\",\"usage\":{\"queue_time\":0.10814194300000002,\"prompt_tokens\":613,\"prompt_time\":0.046598231,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":646,\"total_time\":0.166598231}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_4a5614c73d997eba3fa52b86cffa9383.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_4a5614c73d997eba3fa52b86cffa9383.json
new file mode 100644
index 0000000000..42632a6da3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_4a5614c73d997eba3fa52b86cffa9383.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-66ec7bb7-5f68-4aa9-b527-5db4fc490a5a\",\"object\":\"chat.completion.chunk\",\"created\":1743024123,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5avapercvftgat5sm9hex\"}}\n\ndata: {\"id\":\"chatcmpl-66ec7bb7-5f68-4aa9-b527-5db4fc490a5a\",\"object\":\"chat.completion.chunk\",\"created\":1743024123,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_4pgd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\u003e@John Doe\\u003c/span\\u003e! How are you doing?\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-66ec7bb7-5f68-4aa9-b527-5db4fc490a5a\",\"object\":\"chat.completion.chunk\",\"created\":1743024123,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5avapercvftgat5sm9hex\",\"usage\":{\"queue_time\":0.100565217,\"prompt_tokens\":607,\"prompt_time\":0.063150588,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":664,\"total_time\":0.270423315}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_5b7e76896c131f6fac7186b63a8c8159.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_5b7e76896c131f6fac7186b63a8c8159.json
new file mode 100644
index 0000000000..955afb7254
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_5b7e76896c131f6fac7186b63a8c8159.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d37df059-bdae-4db5-ac26-49c684f7afd2\",\"object\":\"chat.completion.chunk\",\"created\":1742851813,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510bpgfn8tpwcwp98jq38q\"}}\n\ndata: {\"id\":\"chatcmpl-d37df059-bdae-4db5-ac26-49c684f7afd2\",\"object\":\"chat.completion.chunk\",\"created\":1742851813,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_ktc0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\u003e@John Doe\\u003c/span\\u003e! How are you doing?\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d37df059-bdae-4db5-ac26-49c684f7afd2\",\"object\":\"chat.completion.chunk\",\"created\":1742851813,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510bpgfn8tpwcwp98jq38q\",\"usage\":{\"queue_time\":0.102499955,\"prompt_tokens\":616,\"prompt_time\":0.046832021,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":673,\"total_time\":0.254104748}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b7316a4ec571c69741b0185ff2a9c7a9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b7316a4ec571c69741b0185ff2a9c7a9.json
new file mode 100644
index 0000000000..03dcb5aae7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_b7316a4ec571c69741b0185ff2a9c7a9.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-7328eca3-54dc-4f52-99ed-da9993e21537\",\"object\":\"chat.completion.chunk\",\"created\":1743024125,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5avqyerdrjhrg1dvbkmg7\"}}\n\ndata: {\"id\":\"chatcmpl-7328eca3-54dc-4f52-99ed-da9993e21537\",\"object\":\"chat.completion.chunk\",\"created\":1743024125,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_h2ns\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello! How \\u003cstrong\\u003eare you doing?\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-7328eca3-54dc-4f52-99ed-da9993e21537\",\"object\":\"chat.completion.chunk\",\"created\":1743024125,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5avqyerdrjhrg1dvbkmg7\",\"usage\":{\"queue_time\":1.9714321719999999,\"prompt_tokens\":618,\"prompt_time\":0.084497402,\"completion_tokens\":40,\"completion_time\":0.145454545,\"total_tokens\":658,\"total_time\":0.229951947}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_d8cd06e28d1a94e2ece17234ac622785.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_d8cd06e28d1a94e2ece17234ac622785.json
new file mode 100644
index 0000000000..4a168f77d1
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_d8cd06e28d1a94e2ece17234ac622785.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-ab0079f2-6f81-4b2c-b770-136fa05396af\",\"object\":\"chat.completion.chunk\",\"created\":1742851813,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510c3cexmb8rx6ff590xan\"}}\n\ndata: {\"id\":\"chatcmpl-ab0079f2-6f81-4b2c-b770-136fa05396af\",\"object\":\"chat.completion.chunk\",\"created\":1742851813,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_hq5t\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello! How \\u003cstrong\\u003eare you doing?\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ab0079f2-6f81-4b2c-b770-136fa05396af\",\"object\":\"chat.completion.chunk\",\"created\":1742851813,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510c3cexmb8rx6ff590xan\",\"usage\":{\"queue_time\":0.10096317400000002,\"prompt_tokens\":627,\"prompt_time\":0.048262112,\"completion_tokens\":41,\"completion_time\":0.149090909,\"total_tokens\":668,\"total_time\":0.197353021}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_631ca54e466e4791b28d3e98aba55498.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_631ca54e466e4791b28d3e98aba55498.json
new file mode 100644
index 0000000000..a41bca758a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_631ca54e466e4791b28d3e98aba55498.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-3b4722d9-d458-40f0-8a8b-4e0ef2b75eaf\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5ayp9fctr67605vtnj96j\"}}\n\ndata: {\"id\":\"chatcmpl-3b4722d9-d458-40f0-8a8b-4e0ef2b75eaf\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_rxqm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\u003e@Jane Doe\\u003c/span\\u003e! How \\u003cstrong\\u003eare you doing?\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-3b4722d9-d458-40f0-8a8b-4e0ef2b75eaf\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5ayp9fctr67605vtnj96j\",\"usage\":{\"queue_time\":0.10000881700000001,\"prompt_tokens\":605,\"prompt_time\":0.039294023,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":667,\"total_time\":0.264748568}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_906e129bf2e71179489078e290fddf8d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_906e129bf2e71179489078e290fddf8d.json
new file mode 100644
index 0000000000..13995bca21
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_906e129bf2e71179489078e290fddf8d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-0ac25a52-a6c8-4bbd-95d5-7909b2334f30\",\"object\":\"chat.completion.chunk\",\"created\":1742851814,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510d7bfnb9j60jn9mwx85j\"}}\n\ndata: {\"id\":\"chatcmpl-0ac25a52-a6c8-4bbd-95d5-7909b2334f30\",\"object\":\"chat.completion.chunk\",\"created\":1742851814,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_xr2w\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\u003e@Jane Doe\\u003c/span\\u003e! How \\u003cstrong\\u003eare you doing?\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-0ac25a52-a6c8-4bbd-95d5-7909b2334f30\",\"object\":\"chat.completion.chunk\",\"created\":1742851814,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_6507bcfb6f\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510d7bfnb9j60jn9mwx85j\",\"usage\":{\"queue_time\":0.103950498,\"prompt_tokens\":614,\"prompt_time\":0.03252273,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":676,\"total_time\":0.257977275}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_5ba2d1b1d785384a062d2e907d7a6e51.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_5ba2d1b1d785384a062d2e907d7a6e51.json
new file mode 100644
index 0000000000..f9271fdbc4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_5ba2d1b1d785384a062d2e907d7a6e51.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-16140d67-4900-41b3-b3eb-5d782fc61a0a\",\"object\":\"chat.completion.chunk\",\"created\":1742851812,\"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_01jq510b42exkvhm9a4h0hgeq9\"}}\n\ndata: {\"id\":\"chatcmpl-16140d67-4900-41b3-b3eb-5d782fc61a0a\",\"object\":\"chat.completion.chunk\",\"created\":1742851812,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_z56f\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, updated content\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-16140d67-4900-41b3-b3eb-5d782fc61a0a\",\"object\":\"chat.completion.chunk\",\"created\":1742851812,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510b42exkvhm9a4h0hgeq9\",\"usage\":{\"queue_time\":0.298786363,\"prompt_tokens\":622,\"prompt_time\":0.033431104,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":655,\"total_time\":0.153431104}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_794c7cca2e1a4086bb3d3ed0453f07ee.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_794c7cca2e1a4086bb3d3ed0453f07ee.json
new file mode 100644
index 0000000000..4eddeb4844
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_794c7cca2e1a4086bb3d3ed0453f07ee.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-2c979fdc-eb45-464d-8aff-bc4dc566db3c\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5av0gfct9gdgq7jmzkv1c\"}}\n\ndata: {\"id\":\"chatcmpl-2c979fdc-eb45-464d-8aff-bc4dc566db3c\",\"object\":\"chat.completion.chunk\",\"created\":1743024123,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_hppd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"\\u003cp\\u003eHello, updated content\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2c979fdc-eb45-464d-8aff-bc4dc566db3c\",\"object\":\"chat.completion.chunk\",\"created\":1743024123,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5av0gfct9gdgq7jmzkv1c\",\"usage\":{\"queue_time\":0.10097628,\"prompt_tokens\":613,\"prompt_time\":0.040958198,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":642,\"total_time\":0.146412743}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_213fe71abfb49b0d18463ba0e898b1bf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_213fe71abfb49b0d18463ba0e898b1bf.json
new file mode 100644
index 0000000000..93997f6544
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_213fe71abfb49b0d18463ba0e898b1bf.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-adf15a6d-3f71-4231-ae9d-73f99a4e3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5ay0kfctsy3r7rax8zeca\"}}\n\ndata: {\"id\":\"chatcmpl-adf15a6d-3f71-4231-ae9d-73f99a4e3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_7vv1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cstrong\\u003eworld!\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-adf15a6d-3f71-4231-ae9d-73f99a4e3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1743024126,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5ay0kfctsy3r7rax8zeca\",\"usage\":{\"queue_time\":0.102558554,\"prompt_tokens\":610,\"prompt_time\":0.050569105,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":647,\"total_time\":0.18511456}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_245e995e1616524340a13f55922cf6cb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_245e995e1616524340a13f55922cf6cb.json
new file mode 100644
index 0000000000..52e9c3259c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_245e995e1616524340a13f55922cf6cb.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-265cc097-d205-400c-9058-3fd8dcddd7a0\",\"object\":\"chat.completion.chunk\",\"created\":1742851813,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_72a5dc99ee\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510cebexm9gapa53x261t0\"}}\n\ndata: {\"id\":\"chatcmpl-265cc097-d205-400c-9058-3fd8dcddd7a0\",\"object\":\"chat.completion.chunk\",\"created\":1742851814,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_72a5dc99ee\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_496v\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp\\u003eHello, \\u003cstrong\\u003eworld!\\u003c/strong\\u003e\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-265cc097-d205-400c-9058-3fd8dcddd7a0\",\"object\":\"chat.completion.chunk\",\"created\":1742851814,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_72a5dc99ee\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510cebexm9gapa53x261t0\",\"usage\":{\"queue_time\":0.11906640600000001,\"prompt_tokens\":619,\"prompt_time\":0.031825473,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":656,\"total_time\":0.166370928}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_7be37b0e99f86519e90712b338572686.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_7be37b0e99f86519e90712b338572686.json
new file mode 100644
index 0000000000..20d5ccd1d9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_7be37b0e99f86519e90712b338572686.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-bf2b2d27-1d6b-4d76-9909-4ef58ee96461\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5atp7fct9kah9n40v2ms1\"}}\n\ndata: {\"id\":\"chatcmpl-bf2b2d27-1d6b-4d76-9909-4ef58ee96461\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_26af\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\u003eWhat's up, world!\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-bf2b2d27-1d6b-4d76-9909-4ef58ee96461\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5atp7fct9kah9n40v2ms1\",\"usage\":{\"queue_time\":0.106049722,\"prompt_tokens\":617,\"prompt_time\":0.046043447,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":654,\"total_time\":0.180588902}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_a587f118450a5c10d68e623b5c876fa6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_a587f118450a5c10d68e623b5c876fa6.json
new file mode 100644
index 0000000000..c617217ff7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_a587f118450a5c10d68e623b5c876fa6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-323a7804-c35d-4e1a-a6a6-49e340d2928e\",\"object\":\"chat.completion.chunk\",\"created\":1742851812,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq510a3xfn68eys6pcwzhjav\"}}\n\ndata: {\"id\":\"chatcmpl-323a7804-c35d-4e1a-a6a6-49e340d2928e\",\"object\":\"chat.completion.chunk\",\"created\":1742851812,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_c27m\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\u003eWhat's up, world!\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-323a7804-c35d-4e1a-a6a6-49e340d2928e\",\"object\":\"chat.completion.chunk\",\"created\":1742851812,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq510a3xfn68eys6pcwzhjav\",\"usage\":{\"queue_time\":0.712853912,\"prompt_tokens\":626,\"prompt_time\":0.072776682,\"completion_tokens\":41,\"completion_time\":0.149090909,\"total_tokens\":667,\"total_time\":0.221867591}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_7defe29c3454f067a8a5952ffc77ffab.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_7defe29c3454f067a8a5952ffc77ffab.json
new file mode 100644
index 0000000000..02cddcc02d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_7defe29c3454f067a8a5952ffc77ffab.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-f47a7e3d-473a-4126-95d1-9dd330295978\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq5109a6exj87bggbx01h268\"}}\n\ndata: {\"id\":\"chatcmpl-f47a7e3d-473a-4126-95d1-9dd330295978\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_wbe3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\u003eHello, world!\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f47a7e3d-473a-4126-95d1-9dd330295978\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq5109a6exj87bggbx01h268\",\"usage\":{\"queue_time\":0.10782846600000001,\"prompt_tokens\":614,\"prompt_time\":0.039755988,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":653,\"total_time\":0.18157417}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_a91f646c15f13de284ec00a42f41a414.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_a91f646c15f13de284ec00a42f41a414.json
new file mode 100644
index 0000000000..06de610b98
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_a91f646c15f13de284ec00a42f41a414.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-59dcb5c4-7e3e-41e0-8b0c-c0df9da02884\",\"object\":\"chat.completion.chunk\",\"created\":1743024121,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5aszdercrfgdsm8hxhg06\"}}\n\ndata: {\"id\":\"chatcmpl-59dcb5c4-7e3e-41e0-8b0c-c0df9da02884\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_4en5\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\u003eHello, world!\\u003c/p\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-59dcb5c4-7e3e-41e0-8b0c-c0df9da02884\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5aszdercrfgdsm8hxhg06\",\"usage\":{\"queue_time\":0.101010338,\"prompt_tokens\":605,\"prompt_time\":0.10367319,\"completion_tokens\":39,\"completion_time\":0.141818182,\"total_tokens\":644,\"total_time\":0.245491372}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_21cae9637c9d683e20700346debd63de.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_21cae9637c9d683e20700346debd63de.json
new file mode 100644
index 0000000000..54039235f5
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_21cae9637c9d683e20700346debd63de.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-49b3f857-9547-4cbf-947b-c2ef0cdf1848\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5atbqfct9a2bt5kvvaafq\"}}\n\ndata: {\"id\":\"chatcmpl-49b3f857-9547-4cbf-947b-c2ef0cdf1848\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_f4e1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003ch1\\u003eWhat's up, world!\\u003c/h1\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-49b3f857-9547-4cbf-947b-c2ef0cdf1848\",\"object\":\"chat.completion.chunk\",\"created\":1743024122,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5atbqfct9a2bt5kvvaafq\",\"usage\":{\"queue_time\":0.10116313899999999,\"prompt_tokens\":617,\"prompt_time\":0.046659468,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":654,\"total_time\":0.181204923}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_6d099f6023689c7834e913f63bbaddd6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_6d099f6023689c7834e913f63bbaddd6.json
new file mode 100644
index 0000000000..acf10f5588
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_6d099f6023689c7834e913f63bbaddd6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-21818002-2c5e-4d87-a630-83a39ef0af1e\",\"object\":\"chat.completion.chunk\",\"created\":1742851811,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4e32347616\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq5109n4exj9h69szdm4b4ep\"}}\n\ndata: {\"id\":\"chatcmpl-21818002-2c5e-4d87-a630-83a39ef0af1e\",\"object\":\"chat.completion.chunk\",\"created\":1742851811,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4e32347616\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_1n1z\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003ch1\\u003eWhat's up, world!\\u003c/h1\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-21818002-2c5e-4d87-a630-83a39ef0af1e\",\"object\":\"chat.completion.chunk\",\"created\":1742851811,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4e32347616\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq5109n4exj9h69szdm4b4ep\",\"usage\":{\"queue_time\":0.17448702900000002,\"prompt_tokens\":626,\"prompt_time\":0.071139678,\"completion_tokens\":37,\"completion_time\":0.134545455,\"total_tokens\":663,\"total_time\":0.205685133}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_5dc91f0d69b85091833548a11ddfe048.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_5dc91f0d69b85091833548a11ddfe048.json
new file mode 100644
index 0000000000..2497db6ffa
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_5dc91f0d69b85091833548a11ddfe048.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-82292359-f75a-48d0-b058-344fd0eee7de\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq5108xjfn5r5qk9qmr5ej9z\"}}\n\ndata: {\"id\":\"chatcmpl-82292359-f75a-48d0-b058-344fd0eee7de\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_mkgj\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003ch1\\u003eHello, world!\\u003c/h1\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-82292359-f75a-48d0-b058-344fd0eee7de\",\"object\":\"chat.completion.chunk\",\"created\":1742851810,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq5108xjfn5r5qk9qmr5ej9z\",\"usage\":{\"queue_time\":0.129345575,\"prompt_tokens\":614,\"prompt_time\":0.039723524,\"completion_tokens\":34,\"completion_time\":0.123636364,\"total_tokens\":648,\"total_time\":0.163359888}}}\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 (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_bc10e1eaf300d7e6d430a7265171a414.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_bc10e1eaf300d7e6d430a7265171a414.json
new file mode 100644
index 0000000000..365673e04d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_bc10e1eaf300d7e6d430a7265171a414.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-a9054ed7-9221-470e-b7c4-817b3cc16721\",\"object\":\"chat.completion.chunk\",\"created\":1743024121,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5asnmercr6w794p1sak9m\"}}\n\ndata: {\"id\":\"chatcmpl-a9054ed7-9221-470e-b7c4-817b3cc16721\",\"object\":\"chat.completion.chunk\",\"created\":1743024121,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_x02h\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"\\u003ch1\\u003eHello, world!\\u003c/h1\\u003e\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a9054ed7-9221-470e-b7c4-817b3cc16721\",\"object\":\"chat.completion.chunk\",\"created\":1743024121,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5asnmercr6w794p1sak9m\",\"usage\":{\"queue_time\":0.102269785,\"prompt_tokens\":605,\"prompt_time\":0.04667419,\"completion_tokens\":34,\"completion_time\":0.123636364,\"total_tokens\":639,\"total_time\":0.170310554}}}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_6bf38baf29bd79991675ca5dcbe47c1e.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_6bf38baf29bd79991675ca5dcbe47c1e.json
new file mode 100644
index 0000000000..203540d780
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_6bf38baf29bd79991675ca5dcbe47c1e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1Qp8Qul6uQjrSJpU2S7tonDyqc\",\n \"object\": \"chat.completion\",\n \"created\": 1743014648,\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_EX9V9RXzjz4RZimReuzzAfbY\",\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\": 329,\n \"completion_tokens\": 34,\n \"total_tokens\": 363,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_939306e9f6c3d840526a1f516133b9be.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_939306e9f6c3d840526a1f516133b9be.json
new file mode 100644
index 0000000000..6489f5e2d7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_939306e9f6c3d840526a1f516133b9be.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMsSdsgSp2hitL3FpFXESzDSDMS\",\n \"object\": \"chat.completion\",\n \"created\": 1746460202,\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_36ziBhxZQROIcRkMheEKjbdW\",\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\": 555,\n \"completion_tokens\": 34,\n \"total_tokens\": 589,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_d54f6293c0394db48c48483702fd8f00.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_d54f6293c0394db48c48483702fd8f00.json
new file mode 100644
index 0000000000..176939e5df
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_d54f6293c0394db48c48483702fd8f00.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcPckq4fMZava7i0KrMP4KQHyEA\",\n \"object\": \"chat.completion\",\n \"created\": 1742851649,\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_GPRRBalXVdnLvCkz0KW0CXU9\",\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\": 338,\n \"completion_tokens\": 34,\n \"total_tokens\": 372,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_1ba03805f5d360ab3c39045d6a60b9b3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_1ba03805f5d360ab3c39045d6a60b9b3.json
new file mode 100644
index 0000000000..56a8391aba
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_1ba03805f5d360ab3c39045d6a60b9b3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcONGIaavS5VlulYs2bwvhPGGUc\",\n \"object\": \"chat.completion\",\n \"created\": 1742851648,\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_UQzIKGK8iQA1OtUAdod9QgNG\",\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\": 332,\n \"completion_tokens\": 32,\n \"total_tokens\": 364,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a260e250bad5f8da1128af33f097bd84.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a260e250bad5f8da1128af33f097bd84.json
new file mode 100644
index 0000000000..58c207694b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a260e250bad5f8da1128af33f097bd84.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1PhMSiU4MxzwviMGcrsRHfpVBt\",\n \"object\": \"chat.completion\",\n \"created\": 1743014647,\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_HFY0tBlZHi7VGA3oQ0SXEA94\",\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\": 323,\n \"completion_tokens\": 32,\n \"total_tokens\": 355,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a30c763c01f0f6343c61a629efe4a481.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a30c763c01f0f6343c61a629efe4a481.json
new file mode 100644
index 0000000000..647b0ec42b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_a30c763c01f0f6343c61a629efe4a481.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMrFBS7XbKAuWUwPKqDaEzbKU4t\",\n \"object\": \"chat.completion\",\n \"created\": 1746460201,\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_ww1SMDloxnthUD7G2aCWceon\",\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\": 549,\n \"completion_tokens\": 32,\n \"total_tokens\": 581,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_2f3c371626b3aa122196ecd4499b3b75.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_2f3c371626b3aa122196ecd4499b3b75.json
new file mode 100644
index 0000000000..3a927c8e46
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_2f3c371626b3aa122196ecd4499b3b75.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcn9jElafEOCxrjNsuTxlpNY0Gu\",\n \"object\": \"chat.completion\",\n \"created\": 1742851673,\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_Ip2TRB1R1yvGIhFb0rDjXGCG\",\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\": 330,\n \"completion_tokens\": 47,\n \"total_tokens\": 377,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_594f37c43d1e53a497e7304b66e48838.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_594f37c43d1e53a497e7304b66e48838.json
new file mode 100644
index 0000000000..be850c5a75
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_594f37c43d1e53a497e7304b66e48838.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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)\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMpO3yKaNNITzroo49X3ilSgAKU\",\n \"object\": \"chat.completion\",\n \"created\": 1746460199,\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_Wes6gJf40U21NTfRtMlBMXVG\",\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\": 547,\n \"completion_tokens\": 47,\n \"total_tokens\": 594,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_f632aa566d6c4e316400140730d4b8fc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_f632aa566d6c4e316400140730d4b8fc.json
new file mode 100644
index 0000000000..fb6609d252
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_f632aa566d6c4e316400140730d4b8fc.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1MJzufC7J0esTQ5Vt2zqaJZ8td\",\n \"object\": \"chat.completion\",\n \"created\": 1743014644,\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_8KIDkask3BdVkRJ9BFFk0S9y\",\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\": 321,\n \"completion_tokens\": 47,\n \"total_tokens\": 368,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove column_1_93497c3d9f384a95dc6b48b7cdb26789.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove column_1_93497c3d9f384a95dc6b48b7cdb26789.json
new file mode 100644
index 0000000000..bee1d6d682
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove column_1_93497c3d9f384a95dc6b48b7cdb26789.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the second column\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMxuLT2ksxpf7DAxS42UKGMYjsZ\",\n \"object\": \"chat.completion\",\n \"created\": 1746460207,\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_hk1JmHg8qCP2M1sYpfEiGOxb\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
Table Cell 1
Table Cell 3
Table Cell 4
Table Cell 6
Table Cell 7
Table Cell 9
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 617,\n \"completion_tokens\": 156,\n \"total_tokens\": 773,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove last column_1_d815def55950a4cf3eabbeb64a220c6a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove last column_1_d815def55950a4cf3eabbeb64a220c6a.json
new file mode 100644
index 0000000000..cb73760695
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove last column_1_d815def55950a4cf3eabbeb64a220c6a.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the last column\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTvuj02GBIMBH2QBTCxDKgKNBpg0j\",\n \"object\": \"chat.completion\",\n \"created\": 1746473833,\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_8lzIAXeu0p43GC8AMCofJw5q\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 4
Table Cell Bold 5
Table Cell 7
Table Cell 8
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 617,\n \"completion_tokens\": 161,\n \"total_tokens\": 778,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove last row_1_57b3ce143304d3e6dee61a2e1a76a3c9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove last row_1_57b3ce143304d3e6dee61a2e1a76a3c9.json
new file mode 100644
index 0000000000..660fc11736
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove last row_1_57b3ce143304d3e6dee61a2e1a76a3c9.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the last row\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTvulquhdmHNHRH5Tphc4Ae1R3hy0\",\n \"object\": \"chat.completion\",\n \"created\": 1746473835,\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_kxbW2V1vYaTkvWzN0S5LKZNv\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 617,\n \"completion_tokens\": 157,\n \"total_tokens\": 774,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove row_1_bbc7278c05aeec5fb9f890d15691703a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove row_1_bbc7278c05aeec5fb9f890d15691703a.json
new file mode 100644
index 0000000000..935e6c7416
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/remove row_1_bbc7278c05aeec5fb9f890d15691703a.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the second row\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsN0o64bOCQajLRys6jBTBfmFm80\",\n \"object\": \"chat.completion\",\n \"created\": 1746460210,\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_doJlhQqZ2LDTenvnKNqzCZmA\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 7
Table Cell 8
Table Cell 9
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 617,\n \"completion_tokens\": 152,\n \"total_tokens\": 769,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_bfec636ac1d894e23c7daa5587680a4a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_bfec636ac1d894e23c7daa5587680a4a.json
new file mode 100644
index 0000000000..2c5eea575f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_bfec636ac1d894e23c7daa5587680a4a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ15tP7e8RtEAAqcBMKAs6mlTD6n\",\n \"object\": \"chat.completion\",\n \"created\": 1743014627,\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_uitQMhvcrireZWq4ruKvF0Au\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"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\": 320,\n \"completion_tokens\": 28,\n \"total_tokens\": 348,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_dd9c93f8c1d1ca6bafe842cc6896bd96.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_dd9c93f8c1d1ca6bafe842cc6896bd96.json
new file mode 100644
index 0000000000..30d7e7bcf8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_dd9c93f8c1d1ca6bafe842cc6896bd96.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMc7DU6AWb4SAekrlkzs6FTn4XT\",\n \"object\": \"chat.completion\",\n \"created\": 1746460186,\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_QSEgkn54rdYj2miE4ER74DLV\",\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\": 538,\n \"completion_tokens\": 28,\n \"total_tokens\": 566,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_dfd90acf8bc3ac481bccfdb9dd0cf9fd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_dfd90acf8bc3ac481bccfdb9dd0cf9fd.json
new file mode 100644
index 0000000000..18544fc678
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_dfd90acf8bc3ac481bccfdb9dd0cf9fd.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcFQZKre5m6MUhXEGBXbh8sGIFE\",\n \"object\": \"chat.completion\",\n \"created\": 1742851639,\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_Cur8MqYFjsT99SDFlQWh21tM\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"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\": 329,\n \"completion_tokens\": 28,\n \"total_tokens\": 357,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_b4dccffac7a326d1e96b984bfe84367c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_b4dccffac7a326d1e96b984bfe84367c.json
new file mode 100644
index 0000000000..5ba7511917
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_b4dccffac7a326d1e96b984bfe84367c.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMkvwXjRODg7ouaUTOgoOYkIDr4\",\n \"object\": \"chat.completion\",\n \"created\": 1746460194,\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_arycoGsmN8ywSyZn2TsIiTbg\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello, @John Doe! How are you doing? I'm feeling blue!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 540,\n \"completion_tokens\": 66,\n \"total_tokens\": 606,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_dddb03d860730a1e5017dca1906f983d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_dddb03d860730a1e5017dca1906f983d.json
new file mode 100644
index 0000000000..150658d56b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_dddb03d860730a1e5017dca1906f983d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1FNgTVsSoGIirQj8rrNhMwV1NY\",\n \"object\": \"chat.completion\",\n \"created\": 1743014637,\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_P7BkObP7moop5lmWW9J6Fmpx\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello, @John Doe! How are you doing?
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 314,\n \"completion_tokens\": 52,\n \"total_tokens\": 366,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_f91687ea77f6b25e6a7953a6147e3396.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_f91687ea77f6b25e6a7953a6147e3396.json
new file mode 100644
index 0000000000..a81b3de743
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_f91687ea77f6b25e6a7953a6147e3396.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcKhDrkaNuvz8iDE8Ob8smRn8DA\",\n \"object\": \"chat.completion\",\n \"created\": 1742851644,\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_Fo3tlqAqONDDUQTTtQuQeqoo\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello, @John Doe! How are you doing?
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 323,\n \"completion_tokens\": 52,\n \"total_tokens\": 375,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_2372a9143d3b4f86972b8d27917035bf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_2372a9143d3b4f86972b8d27917035bf.json
new file mode 100644
index 0000000000..d02c16c0d3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_2372a9143d3b4f86972b8d27917035bf.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcMOCJ4ydJUYS7kYdSxLKmcQDEL\",\n \"object\": \"chat.completion\",\n \"created\": 1742851646,\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_EskQPDQRb5nDNmW24YeFaCcW\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello! How are you doing?
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 334,\n \"completion_tokens\": 35,\n \"total_tokens\": 369,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_5006e7000fdb500acc971fc1bda83603.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_5006e7000fdb500acc971fc1bda83603.json
new file mode 100644
index 0000000000..c3b126faa0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_5006e7000fdb500acc971fc1bda83603.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? I'm feeling blue!' (remove mention but keep bold 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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMmCIao57Q7koo6A9LKKPgja2K3\",\n \"object\": \"chat.completion\",\n \"created\": 1746460196,\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_XS8sKCU4o2kKQktMKqGyZ989\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello! How are you doing? I'm feeling blue!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 555,\n \"completion_tokens\": 49,\n \"total_tokens\": 604,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_8923c8bf258c1b1e5b591b3b6587eb70.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_8923c8bf258c1b1e5b591b3b6587eb70.json
new file mode 100644
index 0000000000..a5e19fe5eb
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_8923c8bf258c1b1e5b591b3b6587eb70.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1J9CFBpwzUKS9hORBrxBmJLERy\",\n \"object\": \"chat.completion\",\n \"created\": 1743014641,\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_qR5okHhzk6NAbWbNJ3WTksE0\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello! How are you doing?
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 325,\n \"completion_tokens\": 35,\n \"total_tokens\": 360,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_ecaa330191e95da24f86f632cf383c7d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_ecaa330191e95da24f86f632cf383c7d.json
new file mode 100644
index 0000000000..a5c8df7719
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_ecaa330191e95da24f86f632cf383c7d.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMhZEQVSv7Z0wTiq8LJXFxm1rl4\",\n \"object\": \"chat.completion\",\n \"created\": 1746460191,\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_0wNtmhPFDcBUE1sdETcuLuyp\",\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\": 546,\n \"completion_tokens\": 28,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_12cb64264d47f9ec41e7422870338196.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_12cb64264d47f9ec41e7422870338196.json
new file mode 100644
index 0000000000..3df58e1735
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_12cb64264d47f9ec41e7422870338196.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcp90ULnIVtlUUlOcgM2PSnFgFt\",\n \"object\": \"chat.completion\",\n \"created\": 1742851675,\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_ayfu6dTbGi1qXCGjz0o1ojbf\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello, @Jane Doe! How are you doing?
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 321,\n \"completion_tokens\": 57,\n \"total_tokens\": 378,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_5ea94bb2c6cfd5e280ed085a8a22bcf6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_5ea94bb2c6cfd5e280ed085a8a22bcf6.json
new file mode 100644
index 0000000000..7d6a00ff94
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_5ea94bb2c6cfd5e280ed085a8a22bcf6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1NGzjN0Vlen4sDBcQtWhybzjS2\",\n \"object\": \"chat.completion\",\n \"created\": 1743014645,\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_rlaH81S4sDVXhCidSuZ8jlh8\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello, @Jane Doe! How are you doing?
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 312,\n \"completion_tokens\": 57,\n \"total_tokens\": 369,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_d8bf80f655bb45c80fa545dba338e8cc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_d8bf80f655bb45c80fa545dba338e8cc.json
new file mode 100644
index 0000000000..675e94771c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_d8bf80f655bb45c80fa545dba338e8cc.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMqMk4lxqlG5tYAnqmhs6LQo0Qb\",\n \"object\": \"chat.completion\",\n \"created\": 1746460200,\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_0eAHxIN60syLxHM4H2gpFxQF\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hello, @Jane Doe! How are you doing? I'm feeling blue!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 538,\n \"completion_tokens\": 71,\n \"total_tokens\": 609,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_386484769643f55cbc790a7840d829b2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_386484769643f55cbc790a7840d829b2.json
new file mode 100644
index 0000000000..455c645408
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_386484769643f55cbc790a7840d829b2.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block to german\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMipCqECM9ZB3xsjaRSEm5mBuQS\",\n \"object\": \"chat.completion\",\n \"created\": 1746460192,\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_JGevvKgw1bFdNW6MmAhgadex\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
Hallo, @John Doe! Wie geht es dir? Mir ist zumute nach Blau!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 538,\n \"completion_tokens\": 75,\n \"total_tokens\": 613,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_6a28de477ca71c4b728eded37197526c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_6a28de477ca71c4b728eded37197526c.json
new file mode 100644
index 0000000000..dc9ff1bc52
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_6a28de477ca71c4b728eded37197526c.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1EAREsMyW1r7RLa0feGKPp4YtZ\",\n \"object\": \"chat.completion\",\n \"created\": 1743014636,\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_56TVoQw4yRHv3cZLFF0MVu2x\",\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\": 320,\n \"completion_tokens\": 28,\n \"total_tokens\": 348,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_e4b1f9183ec696c7c2e11f24b210fcab.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_e4b1f9183ec696c7c2e11f24b210fcab.json
new file mode 100644
index 0000000000..faebc61153
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_e4b1f9183ec696c7c2e11f24b210fcab.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcJGhoASfp0UHQ8Wgz4jyIU7Nm0\",\n \"object\": \"chat.completion\",\n \"created\": 1742851643,\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_jnMI4vkOtxXlgGvNtiNBwq53\",\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\": 329,\n \"completion_tokens\": 28,\n \"total_tokens\": 357,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_13bff50622d88621ad166d8634f26348.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_13bff50622d88621ad166d8634f26348.json
new file mode 100644
index 0000000000..9612c6620f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_13bff50622d88621ad166d8634f26348.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMoQTPyImrocbQR6FDPheW2mT1H\",\n \"object\": \"chat.completion\",\n \"created\": 1746460198,\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_zgaRPQbaoBITGJqN3IsgYdr9\",\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\": 536,\n \"completion_tokens\": 31,\n \"total_tokens\": 567,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_2c0d42e1012e2e84546ef99a144e3d42.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_2c0d42e1012e2e84546ef99a144e3d42.json
new file mode 100644
index 0000000000..f77cbe518e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_2c0d42e1012e2e84546ef99a144e3d42.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMn1DTmjIzdhARu0y2cb6KpH4HL\",\n \"object\": \"chat.completion\",\n \"created\": 1746460197,\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_MGj2EUGntbG3S7wbEeFBwTiw\",\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\": 543,\n \"completion_tokens\": 32,\n \"total_tokens\": 575,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_1dfd65db9d31cf4b1ab2dddda82aaacb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_1dfd65db9d31cf4b1ab2dddda82aaacb.json
new file mode 100644
index 0000000000..92c3d5ad0d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_1dfd65db9d31cf4b1ab2dddda82aaacb.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1L2vtq2bCjYcAwDnxK4R4BYdDY\",\n \"object\": \"chat.completion\",\n \"created\": 1743014643,\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_vbvvqc2DI8N5DzLJOyGjMFy5\",\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\": 317,\n \"completion_tokens\": 32,\n \"total_tokens\": 349,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_28033da86871eb3777b3eba60f624cff.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_28033da86871eb3777b3eba60f624cff.json
new file mode 100644
index 0000000000..01f6c9cc47
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_28033da86871eb3777b3eba60f624cff.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcNUyAXU0oum8HHA7PRx3sSLmaO\",\n \"object\": \"chat.completion\",\n \"created\": 1742851647,\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_fGQhzjr2FN4vDrE0xB3VXQpV\",\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\": 326,\n \"completion_tokens\": 32,\n \"total_tokens\": 358,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_5568e7d39060d3bc1e48b7d80c905821.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_5568e7d39060d3bc1e48b7d80c905821.json
new file mode 100644
index 0000000000..42f8437fee
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_5568e7d39060d3bc1e48b7d80c905821.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcm7P9E3YeYBLlZ6VvuBzpGNufi\",\n \"object\": \"chat.completion\",\n \"created\": 1742851672,\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_crFiaWrUmnvHCtbdq10T6ORB\",\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\": 332,\n \"completion_tokens\": 36,\n \"total_tokens\": 368,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_7749addc97d5ee6fa8bf7252bfb118f1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_7749addc97d5ee6fa8bf7252bfb118f1.json
new file mode 100644
index 0000000000..9c47d20d5c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_7749addc97d5ee6fa8bf7252bfb118f1.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTrkXoxHudbFAFsQ63frIM4LqkQxa\",\n \"object\": \"chat.completion\",\n \"created\": 1746457825,\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_gHbMWNHAOw9Va3dh73iWQUrq\",\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\": 549,\n \"completion_tokens\": 36,\n \"total_tokens\": 585,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_80d1ad07e2bddafbec615b1b73fae461.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_80d1ad07e2bddafbec615b1b73fae461.json
new file mode 100644
index 0000000000..f0d729ff22
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_80d1ad07e2bddafbec615b1b73fae461.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ1D7gZzyyPc8DksSCuNSmwruqAO\",\n \"object\": \"chat.completion\",\n \"created\": 1743014635,\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_iURGUtBa7aUxS1sDnaewOGvx\",\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\": 323,\n \"completion_tokens\": 36,\n \"total_tokens\": 359,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_87c95b4b400aebf13dea3e8a21189c29.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_87c95b4b400aebf13dea3e8a21189c29.json
new file mode 100644
index 0000000000..a09aeaf408
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_87c95b4b400aebf13dea3e8a21189c29.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcknBD59h8WO6EvVA5Q6FCNizEV\",\n \"object\": \"chat.completion\",\n \"created\": 1742851670,\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_3QMMsPqSHKBDyQILxIPyNNAm\",\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\": 321,\n \"completion_tokens\": 35,\n \"total_tokens\": 356,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_c0999edcdbda9a91a5c740ee12828141.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_c0999edcdbda9a91a5c740ee12828141.json
new file mode 100644
index 0000000000..55dc6fc66e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_c0999edcdbda9a91a5c740ee12828141.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ17GaFDnq7pOrfvcCYdRXTKe7lm\",\n \"object\": \"chat.completion\",\n \"created\": 1743014629,\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_L6IDpjnkYOpQOGsGETVoxZZR\",\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\": 312,\n \"completion_tokens\": 35,\n \"total_tokens\": 347,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_e1d01c481c87efc69aa820182ce19f0b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_e1d01c481c87efc69aa820182ce19f0b.json
new file mode 100644
index 0000000000..511cf6f815
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_e1d01c481c87efc69aa820182ce19f0b.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMebC7JXlZKU4EfYbAWSv1lZaJw\",\n \"object\": \"chat.completion\",\n \"created\": 1746460188,\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_wX9lZEGcXh8ENkA5WHU2e4Yy\",\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\": 538,\n \"completion_tokens\": 35,\n \"total_tokens\": 573,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_55f7c50060eebf901202105eeb299247.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_55f7c50060eebf901202105eeb299247.json
new file mode 100644
index 0000000000..f30301693f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_55f7c50060eebf901202105eeb299247.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcIaK5XKDw1n9oYmS0tv955u3EX\",\n \"object\": \"chat.completion\",\n \"created\": 1742851642,\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_o7tFFynDWupW46lipcrpzlLU\",\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\": 332,\n \"completion_tokens\": 31,\n \"total_tokens\": 363,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_a6e7b275c73cd050cee543a0925e1841.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_a6e7b275c73cd050cee543a0925e1841.json
new file mode 100644
index 0000000000..6b2e557916
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_a6e7b275c73cd050cee543a0925e1841.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ19lteyI0tsBfh6ZJ5ABLqhjKLp\",\n \"object\": \"chat.completion\",\n \"created\": 1743014631,\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_NwF60VSA2bEFsRaQM3Q10Hbh\",\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\": 323,\n \"completion_tokens\": 31,\n \"total_tokens\": 354,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_e6a7f7be772299d9178ba780ce7f3e2f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_e6a7f7be772299d9178ba780ce7f3e2f.json
new file mode 100644
index 0000000000..d897b93c5c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_e6a7f7be772299d9178ba780ce7f3e2f.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTrkGvPFCNEdA0Z8dsi7TUrFVgf7w\",\n \"object\": \"chat.completion\",\n \"created\": 1746457808,\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_iFoe4Mz0leUkijTXt8YFlxZq\",\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\": 549,\n \"completion_tokens\": 31,\n \"total_tokens\": 580,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_1ea166413cdc5436bf79703bdc87ceb8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_1ea166413cdc5436bf79703bdc87ceb8.json
new file mode 100644
index 0000000000..60d54a87cd
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_1ea166413cdc5436bf79703bdc87ceb8.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEjcHCBMw9MOyMrZdCQplonn8zfi1\",\n \"object\": \"chat.completion\",\n \"created\": 1742851641,\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_2a678DKzEAeRYg4DwcCEYYl0\",\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\": 321,\n \"completion_tokens\": 29,\n \"total_tokens\": 350,\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_6ec83003ad\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_56c60bba519b089db8947bd3ff129c28.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_56c60bba519b089db8947bd3ff129c28.json
new file mode 100644
index 0000000000..8e70db5822
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_56c60bba519b089db8947bd3ff129c28.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMdPVcPljMRWTeIMLTff9Jc8CmM\",\n \"object\": \"chat.completion\",\n \"created\": 1746460187,\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_ApUXzPRo53FCk1MkL0tZlVn7\",\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\": 538,\n \"completion_tokens\": 29,\n \"total_tokens\": 567,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_ee5a7211406bbf11d6691364928b1aec.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_ee5a7211406bbf11d6691364928b1aec.json
new file mode 100644
index 0000000000..9d1362410f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_ee5a7211406bbf11d6691364928b1aec.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFQ16kTtez5HtNn7QaLqv6Ci8eOLz\",\n \"object\": \"chat.completion\",\n \"created\": 1743014628,\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_Cy7f3N2Y24Zs9DVV5Ul7xqu8\",\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\": 312,\n \"completion_tokens\": 29,\n \"total_tokens\": 341,\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_6bb567654c\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update table cell_1_8cd69d695b5aaed3d1eb4098f440925b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update table cell_1_8cd69d695b5aaed3d1eb4098f440925b.json
new file mode 100644
index 0000000000..01fcbf264f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update table cell_1_8cd69d695b5aaed3d1eb4098f440925b.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the first cell to 'Hello, world!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTsMvbmeKdeGZjo6BzmbTCaWF2Ah6\",\n \"object\": \"chat.completion\",\n \"created\": 1746460205,\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_AykJ4NnpXVVtYzkHy94j1zzU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
Hello, world!
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 623,\n \"completion_tokens\": 219,\n \"total_tokens\": 842,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update table to caps_1_d2c9ef88fcb16c1a15a7020fddb35c41.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update table to caps_1_d2c9ef88fcb16c1a15a7020fddb35c41.json
new file mode 100644
index 0000000000..792d5a3e51
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update table to caps_1_d2c9ef88fcb16c1a15a7020fddb35c41.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update all table content to CAPS\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BTvugWuImX3IKo4xIekStSCFyDKWs\",\n \"object\": \"chat.completion\",\n \"created\": 1746473830,\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_hYYqIBUUjNIYYwPjwm705P2g\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
TABLE CELL 1
TABLE CELL 2
TABLE CELL 3
TABLE CELL 4
TABLE CELL BOLD 5
TABLE CELL 6
TABLE CELL 7
TABLE CELL 8
TABLE CELL 9
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 619,\n \"completion_tokens\": 222,\n \"total_tokens\": 841,\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_d8864f8b6b\"\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_4828e41fa6db3744fcaf55a634c6360c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_4828e41fa6db3744fcaf55a634c6360c.json
new file mode 100644
index 0000000000..fb63eaa088
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_4828e41fa6db3744fcaf55a634c6360c.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_iwu69IaI3Rm8aT6xStWVuKi7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5KYW6bCFTVL7ZPoqs1H5gz4ZWK\",\"object\":\"chat.completion.chunk\",\"created\":1746459114,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a23636e6fbd8dd34a03a45d14fde89f0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a23636e6fbd8dd34a03a45d14fde89f0.json
new file mode 100644
index 0000000000..4aa5b9ae7d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_a23636e6fbd8dd34a03a45d14fde89f0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_70CHhoOSNjnRjvtF4KUaGI7p\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzqXGHGnhiXuhk1fCV4Ku0nkptY\",\"object\":\"chat.completion.chunk\",\"created\":1743014550,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_1d65a805600a395c5a458f3533c842ba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_1d65a805600a395c5a458f3533c842ba.json
new file mode 100644
index 0000000000..bb9e2a8f13
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_1d65a805600a395c5a458f3533c842ba.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_NrTaSmimWlPXABbeEEs5FeMT\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Im1GLswTVBPL6ErW1ncIciJ71\",\"object\":\"chat.completion.chunk\",\"created\":1746459112,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_e9547ae9eb34ba44905353dbfb6da800.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_e9547ae9eb34ba44905353dbfb6da800.json
new file mode 100644
index 0000000000..6318b0a996
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_e9547ae9eb34ba44905353dbfb6da800.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_03fgtROpZUpPq0v34twLnYnQ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzp4ll1CHFbVIISG2XRWNCoJhh8\",\"object\":\"chat.completion.chunk\",\"created\":1743014549,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_70216235a46a13ef0018c36c1d7b1b61.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_70216235a46a13ef0018c36c1d7b1b61.json
new file mode 100644
index 0000000000..3c067306a0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_70216235a46a13ef0018c36c1d7b1b61.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ZttVX8Q8t0QldMJHZwautnTX\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPznBssGWm04yQcdnfwILkE96uhi\",\"object\":\"chat.completion.chunk\",\"created\":1743014547,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_911a3ae9d420a4bd9f1aff06f8734d8d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_911a3ae9d420a4bd9f1aff06f8734d8d.json
new file mode 100644
index 0000000000..db2e018d7b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_911a3ae9d420a4bd9f1aff06f8734d8d.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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)\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_MuUHYCKiOFrfpzwLBTwq5CzF\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5F2fGUzhvnujuKTUtyyKFV2AUB\",\"object\":\"chat.completion.chunk\",\"created\":1746459109,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove column_1_1b0a31689c06e10b1962f97a033e65dd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove column_1_1b0a31689c06e10b1962f97a033e65dd.json
new file mode 100644
index 0000000000..e083062ca3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove column_1_1b0a31689c06e10b1962f97a033e65dd.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the second column\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_kfLOcR1HOVrI7yxSknqpNQ26\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"4\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"6\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"7\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"9\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5PueH5UxfChT0AtNXagxlPVcGW\",\"object\":\"chat.completion.chunk\",\"created\":1746459119,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove last column_1_c514c6d27e3a3a3e5869ab2e086f3237.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove last column_1_c514c6d27e3a3a3e5869ab2e086f3237.json
new file mode 100644
index 0000000000..04d58251d9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove last column_1_c514c6d27e3a3a3e5869ab2e086f3237.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the last column\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_X82vFCPbyZGxFcYUGdxcZZfG\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"4\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"5\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"7\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"8\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvri2UArkoMiZOiM14HHDaRgEccv\",\"object\":\"chat.completion.chunk\",\"created\":1746473646,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove last row_1_7e1fb882a8f52fa11e82a138bdcf2ddb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove last row_1_7e1fb882a8f52fa11e82a138bdcf2ddb.json
new file mode 100644
index 0000000000..df38dfb7e4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove last row_1_7e1fb882a8f52fa11e82a138bdcf2ddb.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the last row\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_7qgg8s637BL82aSc1vwwPdZA\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"4\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"5\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"6\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrkL5dD7Ys2QjbOqBR8srsqZPdo\",\"object\":\"chat.completion.chunk\",\"created\":1746473648,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove row_1_8000048d08051b32595b3a37ee7fd74f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove row_1_8000048d08051b32595b3a37ee7fd74f.json
new file mode 100644
index 0000000000..709754996c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/remove row_1_8000048d08051b32595b3a37ee7fd74f.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Remove the second row\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_TGdiYzHuelhnLAoXiVAHVWaf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"7\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"8\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"9\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Qc4hlnkYwlF11teqH8y8f2OfQ\",\"object\":\"chat.completion.chunk\",\"created\":1746459120,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_6d478ef0730c3f0f04d5279294564198.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_6d478ef0730c3f0f04d5279294564198.json
new file mode 100644
index 0000000000..dbc911afaa
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_6d478ef0730c3f0f04d5279294564198.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_d13ztanRXJdKcnj39shAGkoz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Welt\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4wdUGSmF5hyXnrhcdUR3M1CW4n\",\"object\":\"chat.completion.chunk\",\"created\":1746459090,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_ecb195991bd4141c0a1e95a35a402c72.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_ecb195991bd4141c0a1e95a35a402c72.json
new file mode 100644
index 0000000000..1a50166aaf
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_ecb195991bd4141c0a1e95a35a402c72.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_9Q7XcQm2ySxmHjlQs0BHUzHo\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzc8ZcuyhfdLwDde8oLYuAqZTaq\",\"object\":\"chat.completion.chunk\",\"created\":1743014536,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e9899ccbe4b0fbeee956c8236b58a8da.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e9899ccbe4b0fbeee956c8236b58a8da.json
new file mode 100644
index 0000000000..a5e23dea88
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_e9899ccbe4b0fbeee956c8236b58a8da.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_7IyrY8t5fRqjU7uGTbfzSYIQ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzjX32TbniIYWGyT1imVm86r49H\",\"object\":\"chat.completion.chunk\",\"created\":1743014543,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_ea31402bfacfb6c2d0998d31a1bad246.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_ea31402bfacfb6c2d0998d31a1bad246.json
new file mode 100644
index 0000000000..5ad8e4af3d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_ea31402bfacfb6c2d0998d31a1bad246.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_CLyVGCGFsLhhPux5ZLlthqbo\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"I'm\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" feeling\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs595mHfdnAc5nRJ8geffOs4c6aE\",\"object\":\"chat.completion.chunk\",\"created\":1746459103,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_94a9cd085ff0f145422e2d6ea9503b3f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_94a9cd085ff0f145422e2d6ea9503b3f.json
new file mode 100644
index 0000000000..1d2333393b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_94a9cd085ff0f145422e2d6ea9503b3f.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? I'm feeling blue!' (remove mention but keep bold 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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Rgwu0h03EosOGt5j6G1R4VSb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"I'm\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" feeling\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Bth6rmsKWo8pGaVwxfKbCzBIF\",\"object\":\"chat.completion.chunk\",\"created\":1746459105,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_c19a87a831217ee11731fce53477569c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_c19a87a831217ee11731fce53477569c.json
new file mode 100644
index 0000000000..b367eff0e8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_c19a87a831217ee11731fce53477569c.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_zTzpEMyKZI3FGA944SbxiuJn\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzk1BBwSW95tfZPOzwTwQQhcK5M\",\"object\":\"chat.completion.chunk\",\"created\":1743014544,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_600cbb4c0af44ee6aeb03a33566d842d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_600cbb4c0af44ee6aeb03a33566d842d.json
new file mode 100644
index 0000000000..e8885ee7f2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_600cbb4c0af44ee6aeb03a33566d842d.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_pqKWD6JiSe8JGpfvp1QbAwhk\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs53Z7Iz8VhahfioX3Psdwdxt7Wh\",\"object\":\"chat.completion.chunk\",\"created\":1746459097,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d1aa66b01feb6b0c749e8c258b2e9179.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d1aa66b01feb6b0c749e8c258b2e9179.json
new file mode 100644
index 0000000000..b6e8e973f2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d1aa66b01feb6b0c749e8c258b2e9179.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_oMe8W6y2BBGdDZbfA3Pa3pwZ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzoO7ESrdbOQ2TLIgvFJGolNdpc\",\"object\":\"chat.completion.chunk\",\"created\":1743014548,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d226e567c397db22b8351bea725773a6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d226e567c397db22b8351bea725773a6.json
new file mode 100644
index 0000000000..36506105f8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d226e567c397db22b8351bea725773a6.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_VYd0vCXOJzZV0XsR5cG0tqrX\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"I'm\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" feeling\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Gu319EiQFxTEpYUzivIEqOecA\",\"object\":\"chat.completion.chunk\",\"created\":1746459110,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_70f59e7fcda7310f42e2cd20bef27e29.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_70f59e7fcda7310f42e2cd20bef27e29.json
new file mode 100644
index 0000000000..415b28577a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_70f59e7fcda7310f42e2cd20bef27e29.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the second block to german\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_HwRADnZjHGdZr50Fbck17Iq3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Wie\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"geht\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" es\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" dir\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Mir\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" ist\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" zum\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ute\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" nach\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Blau\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs55tRRmTzDM4JDMD3Vc9Rmw8OxN\",\"object\":\"chat.completion.chunk\",\"created\":1746459099,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_217edf775cc14939eb2f129f48c2910f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_217edf775cc14939eb2f129f48c2910f.json
new file mode 100644
index 0000000000..1ab0f09718
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_217edf775cc14939eb2f129f48c2910f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_4b7vyDi5WRbM1kgAkKlb3Tjq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPziE5DmJG26KOsQDXgwKniuLUTW\",\"object\":\"chat.completion.chunk\",\"created\":1743014542,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_0c3086a06fdb717fcf7f95c2532cd9ce.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_0c3086a06fdb717fcf7f95c2532cd9ce.json
new file mode 100644
index 0000000000..ce363a0039
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_0c3086a06fdb717fcf7f95c2532cd9ce.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_auttFxkUvgxJUMwiUrD7Cyqo\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5E9E2AEysDjAKFjpT3LeKVLriu\",\"object\":\"chat.completion.chunk\",\"created\":1746459108,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d1eafbbce26e11fb957110afad282a45.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d1eafbbce26e11fb957110afad282a45.json
new file mode 100644
index 0000000000..2187874342
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_d1eafbbce26e11fb957110afad282a45.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ZdAOlqpf9TEavnOsc3FSPGmH\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5Dfp2Wmc4oR19G4Fm7QFnsrLqu\",\"object\":\"chat.completion.chunk\",\"created\":1746459107,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_e3393c13d3c94a9fd38e8a8f21f763ba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_e3393c13d3c94a9fd38e8a8f21f763ba.json
new file mode 100644
index 0000000000..c916f62cc9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_e3393c13d3c94a9fd38e8a8f21f763ba.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_PoT8bImJWTyxNR7bbm6eAGr7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzlO2WSsItaZVznJHi0tCXEDcT5\",\"object\":\"chat.completion.chunk\",\"created\":1743014545,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_6744bdfcba3595e47926f83c728b889a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_6744bdfcba3595e47926f83c728b889a.json
new file mode 100644
index 0000000000..725123da25
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_6744bdfcba3595e47926f83c728b889a.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_CxAaV37okBe8HvjntLg54nD6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-align\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" right\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\";\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs52CXjodN5Mk64Xh9kExtAdmhy5\",\"object\":\"chat.completion.chunk\",\"created\":1746459096,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_acad0fa6e79ca8a9c327d41ec3308dca.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_acad0fa6e79ca8a9c327d41ec3308dca.json
new file mode 100644
index 0000000000..04358f4a9b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_acad0fa6e79ca8a9c327d41ec3308dca.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_HhY5SiRBKNwRBjzJahS3tl2U\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-align\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" right\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\";\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzhiRP6KqKyF3QjaUWXQSTNQBYw\",\"object\":\"chat.completion.chunk\",\"created\":1743014541,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_5b9f0ddb94b3d5e5b568e5dd685b75a3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_5b9f0ddb94b3d5e5b568e5dd685b75a3.json
new file mode 100644
index 0000000000..2da136721c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_5b9f0ddb94b3d5e5b568e5dd685b75a3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_5iAF01IeZW4VvHp51qpDPtUH\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-align\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" right\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\";\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPze7OhvvjFMLTVSlXaC2EXU4pef\",\"object\":\"chat.completion.chunk\",\"created\":1743014538,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_615930421c8856f1eb51773a6eac0d64.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_615930421c8856f1eb51773a6eac0d64.json
new file mode 100644
index 0000000000..7de579cc92
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_615930421c8856f1eb51773a6eac0d64.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ouja8CdB6EyJ3Z8Cghy9RMkD\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-align\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" right\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\";\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4zAuGwg0okMec94ggGL8yLuoGz\",\"object\":\"chat.completion.chunk\",\"created\":1746459093,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_76df571c92567a7556ea4c63ea2f9890.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_76df571c92567a7556ea4c63ea2f9890.json
new file mode 100644
index 0000000000..d297551b93
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_76df571c92567a7556ea4c63ea2f9890.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_8u6uzHCRAhAYx8E8Au83E9ES\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzfaPGFwz8LAvfaxDwUxXHyrrR2\",\"object\":\"chat.completion.chunk\",\"created\":1743014539,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_9a10d00ef83fa148e9859fd5135e3f6b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_9a10d00ef83fa148e9859fd5135e3f6b.json
new file mode 100644
index 0000000000..9977e8b870
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_9a10d00ef83fa148e9859fd5135e3f6b.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"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!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_CecGZbcBo7NBByuPleHqxG6C\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTrjIFaCBAeo7BG0u6IR5PBjoos5p\",\"object\":\"chat.completion.chunk\",\"created\":1746457748,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_878d4253ba30c0351989d3de1582fccd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_878d4253ba30c0351989d3de1582fccd.json
new file mode 100644
index 0000000000..5c66e3283a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_878d4253ba30c0351989d3de1582fccd.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_gnZ9gMed8fp7lOs9BfqBUfVh\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs4y6mSGB0gm2Ugzl21sHt5y8pSk\",\"object\":\"chat.completion.chunk\",\"created\":1746459092,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_9c692b1cb0a4df024b5252391cb099db.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_9c692b1cb0a4df024b5252391cb099db.json
new file mode 100644
index 0000000000..cf5e6237f1
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_9c692b1cb0a4df024b5252391cb099db.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"}]\"},{\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_rMVTbEOfJgc9Uz9uPeJA61kL\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPzdCXorDvOtZBKNOoxCMIM3Ht6u\",\"object\":\"chat.completion.chunk\",\"created\":1743014537,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6bb567654c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update table cell_1_4c08bc8b8f816525d5bb75e6b600e855.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update table cell_1_4c08bc8b8f816525d5bb75e6b600e855.json
new file mode 100644
index 0000000000..8dc5b96536
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update table cell_1_4c08bc8b8f816525d5bb75e6b600e855.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the first cell to 'Hello, world!'\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_0dUdXZpisBKeJCWhvF9qiTuf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"4\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"5\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"6\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"7\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"8\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Cell\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"9\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTs5M5hzNxOvv69DZnoJLj2FAezK3\",\"object\":\"chat.completion.chunk\",\"created\":1746459116,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\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 (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update table to caps_1_44af5d0c7dbdf07bb4370062a725f777.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update table to caps_1_44af5d0c7dbdf07bb4370062a725f777.json
new file mode 100644
index 0000000000..ab7b19a887
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update table to caps_1_44af5d0c7dbdf07bb4370062a725f777.json
@@ -0,0 +1,15 @@
+{
+ "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 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\\\":\\\"
Table Cell 1
Table Cell 2
Table Cell 3
Table Cell 4
Table Cell Bold 5
Table Cell 6
Table Cell 7
Table Cell 8
Table Cell 9
\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update all table content to CAPS\"},{\"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), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating blocks over adding or removing (but this also depends on the user's question).\"}],\"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\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"html of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_mgcbXkGgiuVHOIEe3rvzeGr0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"4\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" B\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"OLD\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"5\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"6\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"7\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"8\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" colspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rowspan\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"TABLE\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" CELL\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"9\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"td\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"tr\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"table\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BTvrclMVI6q1KY7Ph0ELqYwf06SSG\",\"object\":\"chat.completion.chunk\",\"created\":1746473640,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_d8864f8b6b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..865d4a4261
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts
@@ -0,0 +1,130 @@
+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 { testAIModels } from "../../../testUtil/testAIModels.js";
+import { generateSharedTestCases } from "../tests/sharedTestCases.js";
+import { callLLM } from "./htmlBlocks.js";
+
+const BASE_FILE_PATH = path.resolve(
+ __dirname,
+ "__snapshots__",
+ path.basename(__filename)
+);
+
+const fetchCountMap: Record = {};
+
+async function createRequestHash(req: Request) {
+ const url = new URL(req.url);
+ return [
+ // url.host,
+ // url.pathname,
+ toHashString([
+ req.method,
+ url.origin,
+ url.pathname,
+ getSortedEntries(url.searchParams),
+ getSortedEntries(req.headers),
+ // getSortedEntries(req.cookies),
+ new TextDecoder("utf-8").decode(await req.arrayBuffer()),
+ ]),
+ ].join("/");
+}
+
+// Main test suite with snapshot middleware
+describe("Models", () => {
+ // Define server with snapshot middleware for the main tests
+ const server = setupServer(
+ snapshot({
+ updateSnapshots: "missing",
+ // onSnapshotUpdated: "all",
+ // ignoreSnapshots: true,
+ async createSnapshotPath(info) {
+ // use a unique path for each model
+ const t = getCurrentTest()!;
+ const mswPath = path.join(
+ t.suite!.name, // same directory as the test snapshot
+ "__msw_snapshots__",
+ t.suite!.suite!.name, // model / streaming params
+ t.name
+ );
+ // in case there are multiple requests in a test, we need to use a separate snapshot for each request
+ fetchCountMap[mswPath] = (fetchCountMap[mswPath] || 0) + 1;
+ const hash = await createRequestHash(info.request);
+ return mswPath + `_${fetchCountMap[mswPath]}_${hash}.json`;
+ },
+ basePath: BASE_FILE_PATH,
+ // onFetchFromSnapshot(info, snapshot) {
+ // console.log("onFetchFromSnapshot", info, snapshot);
+ // },
+ // onFetchFromServer(info, snapshot) {
+ // console.log("onFetchFromServer", info, snapshot);
+ // },
+ })
+ );
+
+ beforeAll(() => {
+ server.listen();
+ });
+
+ afterAll(() => {
+ server.close();
+ });
+
+ afterEach(() => {
+ delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
+ });
+
+ const testMatrix = [
+ {
+ model: testAIModels.openai,
+ stream: true,
+ },
+ {
+ model: testAIModels.openai,
+ stream: false,
+ },
+ {
+ model: testAIModels.groq,
+ stream: true,
+ },
+ {
+ model: testAIModels.groq,
+ stream: false,
+ },
+ // TODO: https://github.com/vercel/ai/issues/5350
+ // {
+ // model: albert,
+ // stream: true,
+ // },
+ {
+ model: testAIModels.albert,
+ stream: false,
+ },
+
+ // {
+ // model: groq,
+ // },
+ // // {
+ // // model: albert,
+ // // stream: true,
+ // // },
+ ];
+
+ for (const params of testMatrix) {
+ describe(`${params.model.provider}/${params.model.modelId} (${
+ params.stream ? "streaming" : "non-streaming"
+ })`, () => {
+ generateSharedTestCases((editor, options) =>
+ callLLM(editor, {
+ ...options,
+ model: params.model,
+ maxRetries: 0,
+ stream: params.stream,
+ withDelays: false,
+ })
+ );
+ });
+ }
+});
diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts
new file mode 100644
index 0000000000..505a51b752
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts
@@ -0,0 +1,184 @@
+import { Block, BlockNoteEditor } from "@blocknote/core";
+import { generateObject, streamObject } from "ai";
+import type { PromptOrMessages } from "../../index.js";
+import {
+ promptManipulateDocumentUseHTMLBlocks,
+ promptManipulateSelectionHTMLBlocks,
+} from "../../prompts/htmlBlocksPrompt.js";
+import {
+ generateOperations,
+ LLMRequestOptions,
+ streamOperations,
+} from "../../streamTool/callLLMWithStreamTools.js";
+import { StreamTool } from "../../streamTool/streamTool.js";
+import { isEmptyParagraph } from "../../util/emptyBlock.js";
+import { CallLLMResult } from "../CallLLMResult.js";
+import {
+ getDataForPromptNoSelection,
+ getDataForPromptWithSelection,
+} from "./htmlPromptData.js";
+import { tools } from "./tools/index.js";
+
+async function getMessages(
+ editor: BlockNoteEditor,
+ opts: {
+ selectedBlocks?: Block[];
+ excludeBlockIds?: string[];
+ } & PromptOrMessages
+) {
+ // TODO: child blocks
+ // TODO: document how to customize prompt
+ if ("messages" in opts && opts.messages) {
+ return opts.messages;
+ } else if (opts.selectedBlocks) {
+ if (opts.excludeBlockIds) {
+ throw new Error(
+ "expected excludeBlockIds to be false when selectedBlocks is provided"
+ );
+ }
+
+ return promptManipulateSelectionHTMLBlocks({
+ ...(await getDataForPromptWithSelection(editor, opts.selectedBlocks)),
+ userPrompt: opts.userPrompt,
+ });
+ } else {
+ if (opts.useSelection) {
+ throw new Error(
+ "expected useSelection to be false when selectedBlocks is not provided"
+ );
+ }
+ return promptManipulateDocumentUseHTMLBlocks({
+ ...(await getDataForPromptNoSelection(editor, {
+ excludeBlockIds: opts.excludeBlockIds,
+ })),
+ userPrompt: opts.userPrompt,
+ });
+ }
+}
+
+function getStreamTools(
+ 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,
+ };
+
+ const streamTools: StreamTool[] = [
+ ...(mergedStreamTools.update
+ ? [tools.update(editor, { idsSuffixed: true, withDelays, updateSelection: selectionInfo })]
+ : []),
+ ...(mergedStreamTools.add
+ ? [tools.add(editor, { idsSuffixed: true, withDelays })]
+ : []),
+ ...(mergedStreamTools.delete
+ ? [tools.delete(editor, { idsSuffixed: true, withDelays })]
+ : []),
+ ];
+
+ return streamTools;
+}
+
+// TODO: what to expose as api?
+export async function callLLM(
+ editor: BlockNoteEditor,
+ opts: Omit &
+ PromptOrMessages & {
+ 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;
+ };
+ stream?: boolean;
+ deleteEmptyCursorBlock?: boolean;
+ onStart?: () => void;
+ withDelays?: boolean;
+ _generateObjectOptions?: Partial<
+ Parameters>[0]
+ >;
+ _streamObjectOptions?: Partial>[0]>;
+ }
+): Promise {
+ const {
+ userPrompt: prompt,
+ useSelection,
+ deleteEmptyCursorBlock,
+ stream,
+ onStart,
+ withDelays,
+ ...rest
+ } = {
+ deleteEmptyCursorBlock: true,
+ stream: true,
+ withDelays: true,
+ ...opts,
+ };
+
+ const cursorBlock = useSelection
+ ? undefined
+ : editor.getTextCursorPosition().block;
+
+ const deleteCursorBlock: string | undefined =
+ cursorBlock && deleteEmptyCursorBlock && isEmptyParagraph(cursorBlock)
+ ? cursorBlock.id
+ : undefined;
+
+ const selectionInfo = useSelection ? editor.getSelection2() : undefined;
+
+ const messages = await getMessages(editor, {
+ ...opts,
+ selectedBlocks: selectionInfo?.blocks,
+ excludeBlockIds: deleteCursorBlock ? [deleteCursorBlock] : undefined,
+ });
+
+ const streamTools = getStreamTools(editor, withDelays,opts.defaultStreamTools, selectionInfo ? {from: selectionInfo._meta.startPos, to: selectionInfo._meta.endPos} : undefined);
+
+ let response:
+ | Awaited>>
+ | Awaited>>;
+
+ if (stream) {
+ response = await streamOperations(
+ streamTools,
+ {
+ messages,
+ ...rest,
+ },
+ () => {
+ if (deleteCursorBlock) {
+ editor.removeBlocks([deleteCursorBlock]);
+ }
+ onStart?.();
+ }
+ );
+ } else {
+ response = await generateOperations(streamTools, {
+ messages,
+ ...rest,
+ });
+ if (deleteCursorBlock) {
+ editor.removeBlocks([deleteCursorBlock]);
+ }
+ onStart?.();
+ }
+
+return new CallLLMResult(response, streamTools);
+}
diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts
new file mode 100644
index 0000000000..f5567885a7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts
@@ -0,0 +1,37 @@
+import {
+ Block,
+ BlockNoteEditor
+} from "@blocknote/core";
+import { addCursorPosition } from "../../prompts/promptHelpers/addCursorPosition.js";
+import { convertBlocks } from "../../prompts/promptHelpers/convertBlocks.js";
+import { suffixIDs } from "../../prompts/promptHelpers/suffixIds.js";
+import { trimEmptyBlocks } from "../../prompts/promptHelpers/trimEmptyBlocks.js";
+
+ export async function getDataForPromptNoSelection(editor: BlockNoteEditor, opts: {
+ excludeBlockIds?: string[]
+ }) {
+ const input = trimEmptyBlocks(editor.document);
+ const blockArray = await convertBlocks(input, async (block) => {
+ return editor.blocksToHTMLLossy([block]);
+ });
+ const withCursor = addCursorPosition(editor, blockArray);
+ const filtered = withCursor.filter(b => "cursor" in b || !(opts.excludeBlockIds || []).includes(b.id));
+ const suffixed = suffixIDs(filtered);
+ return {
+ htmlBlocks: suffixed,
+ };
+ }
+
+ export async function getDataForPromptWithSelection(editor: BlockNoteEditor, selectedBlocks: Block[]) {
+ const blockArray = await convertBlocks(selectedBlocks, async (block) => {
+ return editor.blocksToHTMLLossy([block]);
+ });
+ const suffixed = suffixIDs(blockArray);
+
+ return {
+ htmlSelectedBlocks: suffixed,
+ htmlDocument: (await convertBlocks(editor.document, async (block) => {
+ return editor.blocksToHTMLLossy([block]);
+ })).map(({ block }) => ({block})), // strip ids so LLM can't accidentally issue updates to ids not in selection
+ };
+ }
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/tools/getPartialHTML.ts b/packages/xl-ai/src/api/formats/html-blocks/tools/getPartialHTML.ts
new file mode 100644
index 0000000000..95d77a1b2e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/tools/getPartialHTML.ts
@@ -0,0 +1,39 @@
+/**
+ * Completes partial HTML by parsing and correcting incomplete tags.
+ * Examples:
+ *
hello ->
hello
+ *
hello
hello
+ *
hello
hello
+ *
hello ->
hello
+ *
hello world ->
hello world
+ *
hello world ->
hello world
+ *
+ * @param html A potentially incomplete HTML string
+ * @returns A properly formed HTML string with all tags closed
+ */
+export function getPartialHTML(html: string): string | undefined {
+ // Simple check: if the last '<' doesn't have a matching '>',
+ // then we have an incomplete tag at the end
+ const lastOpenBracket = html.lastIndexOf("<");
+ const lastCloseBracket = html.lastIndexOf(">");
+
+ // Handle incomplete tags by removing everything after the last complete tag
+ let htmlToProcess = html;
+ if (lastOpenBracket > lastCloseBracket) {
+ htmlToProcess = html.substring(0, lastOpenBracket);
+ // If nothing remains after removing the incomplete tag, return empty string
+ if (!htmlToProcess.trim()) {
+ return undefined;
+ }
+ }
+
+ // TODO: clean script tags?
+ // Parse the HTML
+ const parser = new DOMParser();
+ const doc = parser.parseFromString(
+ `
${htmlToProcess}
`,
+ "text/html",
+ );
+ const el = doc.body.firstChild as HTMLElement;
+ return el ? el.innerHTML : "";
+}
diff --git a/packages/xl-ai/src/api/formats/html-blocks/tools/index.ts b/packages/xl-ai/src/api/formats/html-blocks/tools/index.ts
new file mode 100644
index 0000000000..93583dbe37
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/tools/index.ts
@@ -0,0 +1,102 @@
+import { PartialBlock } from "@blocknote/core";
+import {
+ AddBlocksToolCall,
+ createAddBlocksTool,
+} from "../../../tools/createAddBlocksTool.js";
+import {
+ createUpdateBlockTool,
+ UpdateBlockToolCall,
+} from "../../../tools/createUpdateBlockTool.js";
+import { deleteBlockTool } from "../../../tools/delete.js";
+import { getPartialHTML } from "./getPartialHTML.js";
+import { createHTMLRebaseTool } from "./rebaseTool.js";
+import { validateBlockFunction } from "./validate.js";
+
+export const tools = {
+ add: createAddBlocksTool({
+ description: "Insert new blocks",
+ schema: {
+ block: {
+ $ref: "#/$defs/block",
+ },
+ $defs: {
+ block: { type: "string", description: "html of block" },
+ },
+ },
+ validateBlock: validateBlockFunction,
+ rebaseTool: createHTMLRebaseTool,
+ toJSONToolCall: async (editor, chunk) => {
+ const blocks = (
+ await Promise.all(
+ chunk.operation.blocks.map(async (html) => {
+ const parsedHtml = chunk.isPossiblyPartial
+ ? getPartialHTML(html)
+ : html;
+ if (!parsedHtml) {
+ return [];
+ }
+ return (await editor.tryParseHTMLToBlocks(parsedHtml)).map(
+ (block) => {
+ delete (block as any).id;
+ return block;
+ },
+ );
+ }),
+ )
+ ).flat();
+
+ if (blocks.length === 0) {
+ return undefined;
+ }
+
+ // hacky
+ if ((window as any).__TEST_OPTIONS) {
+ (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS.mockID = 0;
+ }
+
+ return {
+ ...chunk.operation,
+ blocks,
+ } satisfies AddBlocksToolCall>;
+ },
+ }),
+ update: createUpdateBlockTool({
+ description: "Update a block",
+ schema: {
+ block: {
+ $ref: "#/$defs/block",
+ },
+ $defs: {
+ block: { type: "string", description: "html of block" },
+ },
+ },
+ validateBlock: validateBlockFunction,
+ rebaseTool: createHTMLRebaseTool,
+ toJSONToolCall: async (editor, chunk) => {
+ const html = chunk.isPossiblyPartial
+ ? getPartialHTML(chunk.operation.block)
+ : chunk.operation.block;
+
+ if (!html) {
+ return undefined;
+ }
+
+ const block = (await editor.tryParseHTMLToBlocks(html))[0];
+
+ // console.log("update", operation.block);
+ // console.log("html", html);
+ // hacky
+ if ((window as any).__TEST_OPTIONS) {
+ (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS.mockID = 0;
+ }
+
+ delete (block as any).id;
+
+ return {
+ ...chunk.operation,
+ block,
+ } satisfies UpdateBlockToolCall>;
+ },
+ }),
+ delete: deleteBlockTool,
+};
diff --git a/packages/xl-ai/src/api/formats/html-blocks/tools/rebaseTool.ts b/packages/xl-ai/src/api/formats/html-blocks/tools/rebaseTool.ts
new file mode 100644
index 0000000000..0ece0a3cb0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/tools/rebaseTool.ts
@@ -0,0 +1,51 @@
+import { BlockNoteEditor, getBlock } from "@blocknote/core";
+import { updateToReplaceSteps } from "../../../../prosemirror/changeset.js";
+import {
+ getApplySuggestionsTr,
+ rebaseTool,
+} from "../../../../prosemirror/rebaseTool.js";
+
+export async function createHTMLRebaseTool(
+ id: string,
+ editor: BlockNoteEditor,
+) {
+ const tr = getApplySuggestionsTr(editor);
+ const block = getBlock(tr.doc, id);
+ if (!block) {
+ // debugger;
+ throw new Error("block not found");
+ }
+ const html = await editor.blocksToHTMLLossy([block]);
+ const blocks = await editor.tryParseHTMLToBlocks(html);
+ if (blocks.length !== 1) {
+ throw new Error("html diff invalid block count");
+ }
+ const htmlBlock = blocks[0];
+ htmlBlock.id = id;
+ // console.log(html);
+ // console.log(JSON.stringify(blocks, null, 2));
+ const steps = updateToReplaceSteps(
+ {
+ id,
+ block: htmlBlock,
+ type: "update",
+ },
+ tr.doc,
+ );
+
+ if (steps.length) {
+ console.error("html diff", steps);
+ // throw new Error("html diff");
+ }
+ // const stepMapping = new Mapping();
+ // for (const step of steps) {
+ // const mapped = step.map(stepMapping);
+ // if (!mapped) {
+ // throw new Error("Failed to map step");
+ // }
+ // tr.step(mapped);
+ // stepMapping.appendMap(mapped.getMap());
+ // }
+
+ return rebaseTool(editor, tr);
+}
diff --git a/packages/xl-ai/src/api/formats/html-blocks/tools/validate.ts b/packages/xl-ai/src/api/formats/html-blocks/tools/validate.ts
new file mode 100644
index 0000000000..35ffd27e42
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/tools/validate.ts
@@ -0,0 +1,15 @@
+import { InvalidOrOk } from "../../../streamTool/streamTool.js";
+
+export function validateBlockFunction(block: any): InvalidOrOk {
+ if (typeof block !== "string") {
+ return {
+ result: "invalid",
+ reason: "block must be a string",
+ };
+ }
+
+ return {
+ result: "ok",
+ value: block,
+ };
+}
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_15caeff910151fb1c722b42812077431.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_15caeff910151fb1c722b42812077431.json
new file mode 100644
index 0000000000..c882432c8e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_15caeff910151fb1c722b42812077431.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-36257722-8634-44e5-8a3d-e85807f4d860\",\"object\":\"chat.completion\",\"created\":1743024476,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_pbqm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.102630006,\"prompt_tokens\":1104,\"prompt_time\":0.132735961,\"completion_tokens\":20,\"completion_time\":0.072727273,\"total_tokens\":1124,\"total_time\":0.205463234},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jqa5nmj1ew39nsd3r0xhm2hd\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_db652a2755ce32ec61b079674b3ec78e.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_db652a2755ce32ec61b079674b3ec78e.json
new file mode 100644
index 0000000000..936571a736
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_db652a2755ce32ec61b079674b3ec78e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-ed44ce15-1309-4bf6-977e-62173dfc0f23\",\"object\":\"chat.completion\",\"created\":1742832008,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_ekgr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10151289800000002,\"prompt_tokens\":1218,\"prompt_time\":0.085623441,\"completion_tokens\":20,\"completion_time\":0.072727273,\"total_tokens\":1238,\"total_time\":0.158350714},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq4e3zesfzyb3n2tp1j8qpx1\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5521f99323a96b726ef76a66d542ffa7.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5521f99323a96b726ef76a66d542ffa7.json
new file mode 100644
index 0000000000..78c62a6f5b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_5521f99323a96b726ef76a66d542ffa7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d8c52fca-2b09-4491-ad1d-b3cf5c0f3b3a\",\"object\":\"chat.completion.chunk\",\"created\":1743024460,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5n4s0evvv5fves50hyhta\"}}\n\ndata: {\"id\":\"chatcmpl-d8c52fca-2b09-4491-ad1d-b3cf5c0f3b3a\",\"object\":\"chat.completion.chunk\",\"created\":1743024460,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_qbj3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d8c52fca-2b09-4491-ad1d-b3cf5c0f3b3a\",\"object\":\"chat.completion.chunk\",\"created\":1743024460,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5n4s0evvv5fves50hyhta\",\"usage\":{\"queue_time\":0.101237986,\"prompt_tokens\":1104,\"prompt_time\":0.089546146,\"completion_tokens\":20,\"completion_time\":0.072727273,\"total_tokens\":1124,\"total_time\":0.162273419}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_7d07404e0ad1824e8095e5259299b43d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_7d07404e0ad1824e8095e5259299b43d.json
new file mode 100644
index 0000000000..5ec7f87c85
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_7d07404e0ad1824e8095e5259299b43d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-3a1fb412-05c1-4215-8eba-cbe66f501bf8\",\"object\":\"chat.completion.chunk\",\"created\":1742832035,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4e4sf7f4t9ep510zcz65dz\"}}\n\ndata: {\"id\":\"chatcmpl-3a1fb412-05c1-4215-8eba-cbe66f501bf8\",\"object\":\"chat.completion.chunk\",\"created\":1742832035,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_haa8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-3a1fb412-05c1-4215-8eba-cbe66f501bf8\",\"object\":\"chat.completion.chunk\",\"created\":1742832035,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4e4sf7f4t9ep510zcz65dz\",\"usage\":{\"queue_time\":0.101483895,\"prompt_tokens\":1218,\"prompt_time\":0.08678155,\"completion_tokens\":20,\"completion_time\":0.072727273,\"total_tokens\":1238,\"total_time\":0.159508823}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_579ab2da04ddb0abbd88f05b3407eea2.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_579ab2da04ddb0abbd88f05b3407eea2.json
new file mode 100644
index 0000000000..5132537dd5
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_579ab2da04ddb0abbd88f05b3407eea2.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEeB2Y4plhwfQdx0VC4UdqH8St3bo\",\n \"object\": \"chat.completion\",\n \"created\": 1742830732,\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_boe1ycUPrNv7Mlh7KeCX62yp\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"0$\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1094,\n \"completion_tokens\": 15,\n \"total_tokens\": 1109,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1024,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_b40d50f6086068c30932b8a465c8e863.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_b40d50f6086068c30932b8a465c8e863.json
new file mode 100644
index 0000000000..61411015f8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_b40d50f6086068c30932b8a465c8e863.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZQid0MHkTAmfex7HSv9JJRPUpp\",\n \"object\": \"chat.completion\",\n \"created\": 1743024444,\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_XNRxX8j7lTnCJbfVUst3S9UT\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"0$\\\"}]}\"\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\": 15,\n \"total_tokens\": 701,\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_4ecdfc8cdc\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_0815611d70c5ce5c388380d5b34cd66a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_0815611d70c5ce5c388380d5b34cd66a.json
new file mode 100644
index 0000000000..b28d7a431f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_0815611d70c5ce5c388380d5b34cd66a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_CqoPrEQubA5Tt3wNU3bgcqoR\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"delete\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7cLRupZCT7hKEGs9Xmr0y6oHZx\",\"object\":\"chat.completion.chunk\",\"created\":1742830520,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_b005532990a102bfaeac5190ff16d5b1.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_b005532990a102bfaeac5190ff16d5b1.json
new file mode 100644
index 0000000000..3c0a9bb63b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_b005532990a102bfaeac5190ff16d5b1.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_kiJben735PkHAKobws32F7W7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"delete\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYnIpml5F5cyeKsCFktSEpLuiwE\",\"object\":\"chat.completion.chunk\",\"created\":1743024405,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_14b25f32971fc0e7245871c208b4b455.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_14b25f32971fc0e7245871c208b4b455.json
new file mode 100644
index 0000000000..d2b2fc664c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_14b25f32971fc0e7245871c208b4b455.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-76ad66b1-9d84-4391-91ba-9d4800a81f33\",\"object\":\"chat.completion\",\"created\":1742832009,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_5z37\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.101295228,\"prompt_tokens\":1182,\"prompt_time\":0.084592723,\"completion_tokens\":47,\"completion_time\":0.170909091,\"total_tokens\":1229,\"total_time\":0.255501814},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq4e40bdekebaafng39ee3jv\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_baa60b58ba41f5e48edef46d09dde3c8.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_baa60b58ba41f5e48edef46d09dde3c8.json
new file mode 100644
index 0000000000..a1402f1857
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_baa60b58ba41f5e48edef46d09dde3c8.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-b64579fd-0152-4e39-90e3-ee18d174a2b3\",\"object\":\"chat.completion\",\"created\":1743024477,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_0zed\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.125724382,\"prompt_tokens\":1068,\"prompt_time\":0.07757528,\"completion_tokens\":47,\"completion_time\":0.170909091,\"total_tokens\":1115,\"total_time\":0.248484371},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5nnc1ew4tj96n6tty92zt\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_4505017cae43a76af417424ce6f2722a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_4505017cae43a76af417424ce6f2722a.json
new file mode 100644
index 0000000000..9e44db637d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_4505017cae43a76af417424ce6f2722a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-c3a4062f-9d20-42c2-94c7-549fcf053ba3\",\"object\":\"chat.completion\",\"created\":1742832009,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_xkr1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10166492100000002,\"prompt_tokens\":1181,\"prompt_time\":0.083764548,\"completion_tokens\":47,\"completion_time\":0.170909091,\"total_tokens\":1228,\"total_time\":0.254673639},\"system_fingerprint\":\"fp_8dd9fca28c\",\"x_groq\":{\"id\":\"req_01jq4e3zvcekdryamest1ce2xk\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_a9b4c4e9843248dbb57844e4c76d1a7f.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_a9b4c4e9843248dbb57844e4c76d1a7f.json
new file mode 100644
index 0000000000..138c533ab2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_a9b4c4e9843248dbb57844e4c76d1a7f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-1c24d26a-1eb9-4385-845d-15566e47d4a0\",\"object\":\"chat.completion\",\"created\":1743024477,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_hynb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"position\\\": \\\"before\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"blocks\\\": [{\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Test\\\", \\\"styles\\\": {}}]}]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10274638400000001,\"prompt_tokens\":1067,\"prompt_time\":0.076283112,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":1129,\"total_time\":0.301737657},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5nmxffsxvj7rta4fpqyba\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_9efc5693f070eb21ffe2b2ccef581f86.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_9efc5693f070eb21ffe2b2ccef581f86.json
new file mode 100644
index 0000000000..7351f2fe73
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_9efc5693f070eb21ffe2b2ccef581f86.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-0e8af25c-e6a9-4b35-8da8-747d17550807\",\"object\":\"chat.completion.chunk\",\"created\":1742832036,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4e4t8bemgtsnb270bpsd07\"}}\n\ndata: {\"id\":\"chatcmpl-0e8af25c-e6a9-4b35-8da8-747d17550807\",\"object\":\"chat.completion.chunk\",\"created\":1742832036,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_c5pn\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-0e8af25c-e6a9-4b35-8da8-747d17550807\",\"object\":\"chat.completion.chunk\",\"created\":1742832036,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4e4t8bemgtsnb270bpsd07\",\"usage\":{\"queue_time\":0.101439813,\"prompt_tokens\":1182,\"prompt_time\":0.083691804,\"completion_tokens\":47,\"completion_time\":0.170909091,\"total_tokens\":1229,\"total_time\":0.254600895}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_db854e63cab462d3b1f38aa12066b1a3.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_db854e63cab462d3b1f38aa12066b1a3.json
new file mode 100644
index 0000000000..e0420a9245
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_db854e63cab462d3b1f38aa12066b1a3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-8c7c4939-8c8b-47d7-8142-3319cdd23b00\",\"object\":\"chat.completion.chunk\",\"created\":1743024461,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5n5kxevway1thf66nsr4b\"}}\n\ndata: {\"id\":\"chatcmpl-8c7c4939-8c8b-47d7-8142-3319cdd23b00\",\"object\":\"chat.completion.chunk\",\"created\":1743024461,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_2a3z\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8c7c4939-8c8b-47d7-8142-3319cdd23b00\",\"object\":\"chat.completion.chunk\",\"created\":1743024461,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5n5kxevway1thf66nsr4b\",\"usage\":{\"queue_time\":0.125882563,\"prompt_tokens\":1068,\"prompt_time\":0.079965907,\"completion_tokens\":47,\"completion_time\":0.170909091,\"total_tokens\":1115,\"total_time\":0.250874998}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_e3f5b55e19bf952729db718a117b45d0.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_e3f5b55e19bf952729db718a117b45d0.json
new file mode 100644
index 0000000000..42d9e38ddc
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_e3f5b55e19bf952729db718a117b45d0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-aae48d9d-b4d5-462a-a548-c1467c539b1e\",\"object\":\"chat.completion.chunk\",\"created\":1743024461,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5n54qevvtzm9krh6cyjx9\"}}\n\ndata: {\"id\":\"chatcmpl-aae48d9d-b4d5-462a-a548-c1467c539b1e\",\"object\":\"chat.completion.chunk\",\"created\":1743024461,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_0n8w\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"position\\\": \\\"before\\\", \\\"blocks\\\": [{\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Test\\\", \\\"styles\\\": {}}]}]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-aae48d9d-b4d5-462a-a548-c1467c539b1e\",\"object\":\"chat.completion.chunk\",\"created\":1743024461,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5n54qevvtzm9krh6cyjx9\",\"usage\":{\"queue_time\":0.101510444,\"prompt_tokens\":1067,\"prompt_time\":0.082024247,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":1129,\"total_time\":0.307478792}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_f258d2ad2e275e7e86aa60f3dc7f369e.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_f258d2ad2e275e7e86aa60f3dc7f369e.json
new file mode 100644
index 0000000000..855e1362bd
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_f258d2ad2e275e7e86aa60f3dc7f369e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-a88e3dbc-1488-4274-8a0e-34dc529f70c3\",\"object\":\"chat.completion.chunk\",\"created\":1742832035,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4e4svyemgbybe5t6mqpxph\"}}\n\ndata: {\"id\":\"chatcmpl-a88e3dbc-1488-4274-8a0e-34dc529f70c3\",\"object\":\"chat.completion.chunk\",\"created\":1742832036,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_9d40\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a88e3dbc-1488-4274-8a0e-34dc529f70c3\",\"object\":\"chat.completion.chunk\",\"created\":1742832036,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4e4svyemgbybe5t6mqpxph\",\"usage\":{\"queue_time\":0.101791062,\"prompt_tokens\":1181,\"prompt_time\":0.083740574,\"completion_tokens\":47,\"completion_time\":0.170909091,\"total_tokens\":1228,\"total_time\":0.254649665}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_1049d21a96daf11d8db0a8ae9543f777.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_1049d21a96daf11d8db0a8ae9543f777.json
new file mode 100644
index 0000000000..99931fffd5
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_1049d21a96daf11d8db0a8ae9543f777.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEeB471j6z7GDuwSpjaIhu75ENQze\",\n \"object\": \"chat.completion\",\n \"created\": 1742830734,\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_jHJKNYUyez1M2rSkatOacMoO\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\"}]}]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1056,\n \"completion_tokens\": 40,\n \"total_tokens\": 1096,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_32ec155eb7c6a6a6b10d3fa826eeed68.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_32ec155eb7c6a6a6b10d3fa826eeed68.json
new file mode 100644
index 0000000000..837f0da1b4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_32ec155eb7c6a6a6b10d3fa826eeed68.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZRUSXbBIyb9aEZ2mByzeB5ktFM\",\n \"object\": \"chat.completion\",\n \"created\": 1743024445,\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_Cd3FZJQwldMAjfkWsHytZqPp\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 648,\n \"completion_tokens\": 44,\n \"total_tokens\": 692,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_64a94c336f47517ffd5c09353da89cfd.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_64a94c336f47517ffd5c09353da89cfd.json
new file mode 100644
index 0000000000..2be44ca332
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_64a94c336f47517ffd5c09353da89cfd.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEeB25aDd77C5NGxpffpbyaFrhLdJ\",\n \"object\": \"chat.completion\",\n \"created\": 1742830732,\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_eQyls0lb7aB8u1i7uTIv3wMB\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1055,\n \"completion_tokens\": 44,\n \"total_tokens\": 1099,\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_83df987f64\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_dc8e18467e53fdad02468dcce090d317.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_dc8e18467e53fdad02468dcce090d317.json
new file mode 100644
index 0000000000..7c28fd9e65
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_dc8e18467e53fdad02468dcce090d317.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZQm5rjU2byxjytQetrOXqqd4fa\",\n \"object\": \"chat.completion\",\n \"created\": 1743024444,\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_5ShZfNBJ8Ko2OYWMCTocjCNk\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Test\\\",\\\"styles\\\":{}}]}]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 647,\n \"completion_tokens\": 44,\n \"total_tokens\": 691,\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_4ecdfc8cdc\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_3d673e3a6c3cf50a1c33bbe0216dac1e.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_3d673e3a6c3cf50a1c33bbe0216dac1e.json
new file mode 100644
index 0000000000..1e0a55a556
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_3d673e3a6c3cf50a1c33bbe0216dac1e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_j5hJKiZLbMOnRt9e2GQnWqrM\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYpjkls6zQvxsJxR4Hw5BihNL30\",\"object\":\"chat.completion.chunk\",\"created\":1743024407,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_e124148be72427f0a64247ff47b7f0e4.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_e124148be72427f0a64247ff47b7f0e4.json
new file mode 100644
index 0000000000..52ddde8e7a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_e124148be72427f0a64247ff47b7f0e4.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_TCz3qITiUi5ZwN0JYjcCTDcm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7f6iTBGtv4svEPeIUcZhkLrVHT\",\"object\":\"chat.completion.chunk\",\"created\":1742830523,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_2c15799f7bbfa91a53c86a6662224f87.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_2c15799f7bbfa91a53c86a6662224f87.json
new file mode 100644
index 0000000000..2bd38ca618
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_2c15799f7bbfa91a53c86a6662224f87.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_fmiDhNCNtUCyNlQ5WnWDdZz6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYowReT0jXKPiHiroysFFJtVCdZ\",\"object\":\"chat.completion.chunk\",\"created\":1743024406,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_d4ecf679fb2579c6181fe21568334106.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_d4ecf679fb2579c6181fe21568334106.json
new file mode 100644
index 0000000000..93f5c16925
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_d4ecf679fb2579c6181fe21568334106.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_GSGB32pb43GiA0zAb5sSnkRV\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe7dxfCMuT8wyutvsVjvnbBzTMho\",\"object\":\"chat.completion.chunk\",\"created\":1742830521,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4419802c6ce0c24eda050d1cfd7cebba.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4419802c6ce0c24eda050d1cfd7cebba.json
new file mode 100644
index 0000000000..2fff8729e2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4419802c6ce0c24eda050d1cfd7cebba.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-bdd54b0b-f715-47f0-aa73-62b355ad09cf\",\"object\":\"chat.completion\",\"created\":1743024476,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_abyj\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hi, world! Bold the text. Link.\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10022997100000001,\"prompt_tokens\":1309,\"prompt_time\":0.093051871,\"completion_tokens\":64,\"completion_time\":0.232727273,\"total_tokens\":1373,\"total_time\":0.325779144},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5nm30fsxt8btfh2h34y4w\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_54bcb3abe8aaf20521dec8dd7758c059.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_54bcb3abe8aaf20521dec8dd7758c059.json
new file mode 100644
index 0000000000..de45ac62dc
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_54bcb3abe8aaf20521dec8dd7758c059.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-e80a39b4-44d2-4ba5-b42f-22ba8942799d\",\"object\":\"chat.completion\",\"created\":1742837658,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_k5hf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hi, world! Bold the text. Link.\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.985392389,\"prompt_tokens\":1423,\"prompt_time\":0.221165944,\"completion_tokens\":64,\"completion_time\":0.310663307,\"total_tokens\":1487,\"total_time\":0.531829251},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jq4kgbspe8av96s94yw7349w\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_4d937a23f6a467e4b207344fc478751f.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_4d937a23f6a467e4b207344fc478751f.json
new file mode 100644
index 0000000000..21e1655c49
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_4d937a23f6a467e4b207344fc478751f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-20a93376-463a-406f-a6b1-5497e329c4d5\",\"object\":\"chat.completion\",\"created\":1743024475,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_t859\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world! Bold text. Link.\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10034030299999999,\"prompt_tokens\":1303,\"prompt_time\":0.098241097,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":1365,\"total_time\":0.323695642},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5nkm8fsx8vktfgyjt84qw\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_6d4e3319da1c4873d76b02926091ed6e.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_6d4e3319da1c4873d76b02926091ed6e.json
new file mode 100644
index 0000000000..99b32cd054
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_6d4e3319da1c4873d76b02926091ed6e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-0c6d7f35-39da-4c75-ae53-26985fad46dd\",\"object\":\"chat.completion\",\"created\":1742837608,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_vnnv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world! Bold text. Link.\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.130478881,\"prompt_tokens\":1417,\"prompt_time\":0.314713952,\"completion_tokens\":63,\"completion_time\":0.268407907,\"total_tokens\":1480,\"total_time\":0.583121859},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq4kew77e6ybsnrb5y5qc28m\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_1267d15ccb29e4c04fb7abe1d44a6074.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_1267d15ccb29e4c04fb7abe1d44a6074.json
new file mode 100644
index 0000000000..dc5bd34401
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_1267d15ccb29e4c04fb7abe1d44a6074.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-af1d3556-9f71-423f-a0cb-e62dab6c62e6\",\"object\":\"chat.completion\",\"created\":1743024474,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_1ee6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"Jane Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.11816457699999999,\"prompt_tokens\":1301,\"prompt_time\":0.163752409,\"completion_tokens\":89,\"completion_time\":0.323636364,\"total_tokens\":1390,\"total_time\":0.487388773},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5nj4yew39nc36m1zpcfa4\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_952a11dca3a24f332845bb109523d473.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_952a11dca3a24f332845bb109523d473.json
new file mode 100644
index 0000000000..9ccd40eb24
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_952a11dca3a24f332845bb109523d473.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-7a4afb15-1c20-415a-aa3c-8a0a345336b0\",\"object\":\"chat.completion\",\"created\":1742837607,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_2ttg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"Jane Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.13005826799999998,\"prompt_tokens\":1415,\"prompt_time\":0.107772511,\"completion_tokens\":89,\"completion_time\":0.323636364,\"total_tokens\":1504,\"total_time\":0.431408875},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq4kettre708f5sne57z49e4\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_dc577ea4d6c271fdfcb228188cd26d20.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_dc577ea4d6c271fdfcb228188cd26d20.json
new file mode 100644
index 0000000000..f69485ef53
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_dc577ea4d6c271fdfcb228188cd26d20.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-d185585b-3b40-4bef-b85f-b5ba35f59b23\",\"object\":\"chat.completion\",\"created\":1743024469,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_gkys\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, updated content\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10156177699999999,\"prompt_tokens\":1300,\"prompt_time\":0.097561327,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1358,\"total_time\":0.308470418},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5nd3efgfre9vv53gr4r5a\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_ea66181d1b01551dad90bdfdcf443655.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_ea66181d1b01551dad90bdfdcf443655.json
new file mode 100644
index 0000000000..17311e2b6b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_ea66181d1b01551dad90bdfdcf443655.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-0db57b6a-3e33-4b64-8ba2-d87a25dfabd4\",\"object\":\"chat.completion\",\"created\":1742837530,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_sz6e\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, updated content\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":1.3156870489999999,\"prompt_tokens\":1414,\"prompt_time\":0.156797845,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1472,\"total_time\":0.367706936},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jq4kce89e5hsx7g65wfd30gh\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_388d4b196405471a51a88950a44b04fc.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_388d4b196405471a51a88950a44b04fc.json
new file mode 100644
index 0000000000..bebe531bf1
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_388d4b196405471a51a88950a44b04fc.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-2adbb216-7b39-4c7a-acde-4a8a4ae0daee\",\"object\":\"chat.completion\",\"created\":1743024472,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_65t9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"John Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"! How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.103444448,\"prompt_tokens\":1294,\"prompt_time\":0.175122303,\"completion_tokens\":110,\"completion_time\":0.4,\"total_tokens\":1404,\"total_time\":0.575122303},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5ng4zew0rfrzfx5k3rgb5\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_415bf4b3cc6a1dd0ff6c83b8534b6ed7.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_415bf4b3cc6a1dd0ff6c83b8534b6ed7.json
new file mode 100644
index 0000000000..ecdc026800
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_415bf4b3cc6a1dd0ff6c83b8534b6ed7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-8be7436a-d2af-4c14-a980-c2e4a6a8527a\",\"object\":\"chat.completion\",\"created\":1742837515,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_bn0z\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"John Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"! How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.45670444400000004,\"prompt_tokens\":1408,\"prompt_time\":0.146246991,\"completion_tokens\":110,\"completion_time\":0.4,\"total_tokens\":1518,\"total_time\":0.546246991},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jq4kc0tte57smjnwh1y0tdky\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_9416f389f1459ce111f827b5b4475372.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_9416f389f1459ce111f827b5b4475372.json
new file mode 100644
index 0000000000..8a8fea9c11
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_9416f389f1459ce111f827b5b4475372.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-cf92fc39-4236-439a-8190-0541d3e793c1\",\"object\":\"chat.completion\",\"created\":1743024473,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_5n4w\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello! \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"How are you doing?\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10730655,\"prompt_tokens\":1305,\"prompt_time\":0.270945548,\"completion_tokens\":80,\"completion_time\":0.290909091,\"total_tokens\":1385,\"total_time\":0.561854639},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jqa5ngvqew18repkzyv4t0g6\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_ea8ee34c92144e3cd2ed4e33b38f0882.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_ea8ee34c92144e3cd2ed4e33b38f0882.json
new file mode 100644
index 0000000000..7ceeeab487
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_ea8ee34c92144e3cd2ed4e33b38f0882.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-a57d0106-995a-45c2-b4e7-90fec971432a\",\"object\":\"chat.completion\",\"created\":1742837512,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_sc6k\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello! \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.5499290109999999,\"prompt_tokens\":1419,\"prompt_time\":0.278688262,\"completion_tokens\":96,\"completion_time\":0.349090909,\"total_tokens\":1515,\"total_time\":0.627779171},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jq4kbxcsfp9b4danmaqrpx01\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_0aad542a691ec1380d99b9c4cdd3bf5a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_0aad542a691ec1380d99b9c4cdd3bf5a.json
new file mode 100644
index 0000000000..b3b100410b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_0aad542a691ec1380d99b9c4cdd3bf5a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-17819d9a-1759-4d18-97d9-4829b683ef2d\",\"object\":\"chat.completion\",\"created\":1743024475,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_cqag\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"left\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"Jane Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"! How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {\\\"bold\\\": true}}], \\\"children\\\": []}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.11849548000000001,\"prompt_tokens\":1292,\"prompt_time\":0.09287677,\"completion_tokens\":136,\"completion_time\":0.494545455,\"total_tokens\":1428,\"total_time\":0.587422225},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5njseew39g6e2g5ybvyn7\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_209d5b895f2efa8282f9c379c1cb5353.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_209d5b895f2efa8282f9c379c1cb5353.json
new file mode 100644
index 0000000000..98f2a63e41
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_209d5b895f2efa8282f9c379c1cb5353.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-30d71c33-ebd7-4a13-a0ca-a79f1c42deed\",\"object\":\"chat.completion\",\"created\":1742837607,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_dv98\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"left\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"Jane Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"! How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {\\\"bold\\\": true}}], \\\"children\\\": []}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.130969526,\"prompt_tokens\":1406,\"prompt_time\":0.15327202,\"completion_tokens\":136,\"completion_time\":0.494545455,\"total_tokens\":1542,\"total_time\":0.647817475},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq4kevdke719183j38sjyz92\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_9d78ba375d172e2621b6c228bed8beb7.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_9d78ba375d172e2621b6c228bed8beb7.json
new file mode 100644
index 0000000000..ee99afc322
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_9d78ba375d172e2621b6c228bed8beb7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-b1d5cf05-f474-42c6-b15b-f30d8c077002\",\"object\":\"chat.completion\",\"created\":1742837509,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_f0gb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, updated content\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.278223719,\"prompt_tokens\":1414,\"prompt_time\":0.318313215,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1472,\"total_time\":0.529222306},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jq4kbtvee539wv26y9p9mspz\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_b54d47bc607124bb9c32ec2d9862d649.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_b54d47bc607124bb9c32ec2d9862d649.json
new file mode 100644
index 0000000000..7cd2e87302
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_b54d47bc607124bb9c32ec2d9862d649.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-69f66448-49d8-4c24-9539-851183422e0b\",\"object\":\"chat.completion\",\"created\":1743024471,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_qs88\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, updated content\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.106086871,\"prompt_tokens\":1300,\"prompt_time\":0.097892814,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1358,\"total_time\":0.308801905},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jqa5nfpyew0814c1tmje2xt8\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_442345e7235a691813e0704ef1bc19e3.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_442345e7235a691813e0704ef1bc19e3.json
new file mode 100644
index 0000000000..bec8f77e1c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_442345e7235a691813e0704ef1bc19e3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-554dc27b-0b23-4c8f-a63e-543d1cc55fae\",\"object\":\"chat.completion\",\"created\":1743024473,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_xzya\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"world!\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10887605200000001,\"prompt_tokens\":1297,\"prompt_time\":0.09170162,\"completion_tokens\":77,\"completion_time\":0.28,\"total_tokens\":1374,\"total_time\":0.37170162},\"system_fingerprint\":\"fp_8dd9fca28c\",\"x_groq\":{\"id\":\"req_01jqa5nhm1ew1tn0w05w9pmsrs\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_d1e1fd46dfa505623e634488b2c6c8f6.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_d1e1fd46dfa505623e634488b2c6c8f6.json
new file mode 100644
index 0000000000..d919c4799d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_d1e1fd46dfa505623e634488b2c6c8f6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-f3c2cd9c-ea47-45e4-8213-f9ec14ac276b\",\"object\":\"chat.completion\",\"created\":1742837606,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_3qkh\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"world!\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.129578474,\"prompt_tokens\":1411,\"prompt_time\":0.285010775,\"completion_tokens\":77,\"completion_time\":0.28,\"total_tokens\":1488,\"total_time\":0.565010775},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq4ket3be709t3dk76da035x\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5fdbfba1ffe41876405c9125ca212e51.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5fdbfba1ffe41876405c9125ca212e51.json
new file mode 100644
index 0000000000..387dd45585
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5fdbfba1ffe41876405c9125ca212e51.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-43322a8d-e471-4eea-88a4-54ad3345126e\",\"object\":\"chat.completion\",\"created\":1742837494,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_t2sa\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"right\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's up, world!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":21.213004919,\"prompt_tokens\":1418,\"prompt_time\":0.151411249,\"completion_tokens\":78,\"completion_time\":0.288165649,\"total_tokens\":1496,\"total_time\":0.439576898},\"system_fingerprint\":\"fp_3884478861\",\"x_groq\":{\"id\":\"req_01jq4kar9re43thskdnptx36tm\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_6517c2cdfe24e8c689f2998a8ec4c953.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_6517c2cdfe24e8c689f2998a8ec4c953.json
new file mode 100644
index 0000000000..5058fd537b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_6517c2cdfe24e8c689f2998a8ec4c953.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-a75ec765-a9fd-4115-92e3-ee20fd3e952a\",\"object\":\"chat.completion\",\"created\":1743024471,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_drsg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"right\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's up, world!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.101576892,\"prompt_tokens\":1304,\"prompt_time\":0.098095401,\"completion_tokens\":79,\"completion_time\":0.287272727,\"total_tokens\":1383,\"total_time\":0.385368128},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jqa5nf3xfggame189x5qgx3z\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_6513686299d203265a39e7a1c6adedd3.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_6513686299d203265a39e7a1c6adedd3.json
new file mode 100644
index 0000000000..8ef2366d33
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_6513686299d203265a39e7a1c6adedd3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-782322c6-87c7-4b65-a2f2-6e5613b6cde1\",\"object\":\"chat.completion\",\"created\":1743024470,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_646h\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"right\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.124597547,\"prompt_tokens\":1292,\"prompt_time\":0.092047503,\"completion_tokens\":76,\"completion_time\":0.276363636,\"total_tokens\":1368,\"total_time\":0.368411139},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5ne4ffggb8d551jc186ca\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_72f5f070b3af64229dd23ea5255aaa5e.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_72f5f070b3af64229dd23ea5255aaa5e.json
new file mode 100644
index 0000000000..6fac5d1616
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_72f5f070b3af64229dd23ea5255aaa5e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-9555bf78-1566-4b00-a5f3-52c6b12b266a\",\"object\":\"chat.completion\",\"created\":1742837475,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_r0x6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"right\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world!\\\", \\\"styles\\\": {}}], \\\"children\\\": []}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":12.040464313000001,\"prompt_tokens\":1406,\"prompt_time\":0.172301453,\"completion_tokens\":80,\"completion_time\":0.290909091,\"total_tokens\":1486,\"total_time\":0.463210544},\"system_fingerprint\":\"fp_fcc3b74982\",\"x_groq\":{\"id\":\"req_01jq4kaegne47bkw3ayct92fnb\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_5cf8dcb0ccdedb1169305ef8be723236.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_5cf8dcb0ccdedb1169305ef8be723236.json
new file mode 100644
index 0000000000..d98abb2d83
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_5cf8dcb0ccdedb1169305ef8be723236.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-f09011ba-5c30-4519-9be6-ed76666ceb12\",\"object\":\"chat.completion\",\"created\":1742837505,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_bfd8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's up, world!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10520079599999999,\"prompt_tokens\":1418,\"prompt_time\":0.200077522,\"completion_tokens\":64,\"completion_time\":0.232727273,\"total_tokens\":1482,\"total_time\":0.432804795},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jq4kbpxye4zv2w3epjzg1vx9\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_d3fd45d4b70ab455726d9df6f178bf53.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_d3fd45d4b70ab455726d9df6f178bf53.json
new file mode 100644
index 0000000000..ffbcdbf186
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_d3fd45d4b70ab455726d9df6f178bf53.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-e80ff31c-c241-4d04-aa71-0a99a6544f0e\",\"object\":\"chat.completion\",\"created\":1743024470,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_3jkr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's up, world!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.09880248500000001,\"prompt_tokens\":1304,\"prompt_time\":0.103207711,\"completion_tokens\":64,\"completion_time\":0.232727273,\"total_tokens\":1368,\"total_time\":0.335934984},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jqa5nen0ew099p6y7ch3qche\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_129e945ffb5970507c4c43c668f9abd1.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_129e945ffb5970507c4c43c668f9abd1.json
new file mode 100644
index 0000000000..a44e529138
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_129e945ffb5970507c4c43c668f9abd1.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-79afc731-acd9-4645-9461-9f5cd4585b83\",\"object\":\"chat.completion\",\"created\":1743024469,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_gtc2\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.099796103,\"prompt_tokens\":1292,\"prompt_time\":0.090863787,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":1354,\"total_time\":0.316318332},\"system_fingerprint\":\"fp_8dd9fca28c\",\"x_groq\":{\"id\":\"req_01jqa5ndkkfgfts2kbexhd900q\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_3acb2baf2d8f6002aa2b463881bb8e06.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_3acb2baf2d8f6002aa2b463881bb8e06.json
new file mode 100644
index 0000000000..0bdd05248f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_3acb2baf2d8f6002aa2b463881bb8e06.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-837de232-4932-4509-824b-e9ffccf5e7ec\",\"object\":\"chat.completion\",\"created\":1742837517,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_y92m\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world!\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.5047950460000001,\"prompt_tokens\":1406,\"prompt_time\":0.735308745,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":1468,\"total_time\":0.96076329},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jq4kc34vfpavgdf4edy42r6r\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_84f6f880d870a4fe874bc99ac665a237.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_84f6f880d870a4fe874bc99ac665a237.json
new file mode 100644
index 0000000000..8f10bd4fca
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_84f6f880d870a4fe874bc99ac665a237.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d657a0c4-d156-400e-8235-8ac6d2a5f719\",\"object\":\"chat.completion.chunk\",\"created\":1742837606,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kesg3e6xvmmh308fsydja\"}}\n\ndata: {\"id\":\"chatcmpl-d657a0c4-d156-400e-8235-8ac6d2a5f719\",\"object\":\"chat.completion.chunk\",\"created\":1742837606,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_xjdr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hi, world! Bold the text. Link.\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d657a0c4-d156-400e-8235-8ac6d2a5f719\",\"object\":\"chat.completion.chunk\",\"created\":1742837606,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kesg3e6xvmmh308fsydja\",\"usage\":{\"queue_time\":0.13127353400000003,\"prompt_tokens\":1423,\"prompt_time\":0.118569094,\"completion_tokens\":64,\"completion_time\":0.232727273,\"total_tokens\":1487,\"total_time\":0.351296367}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_87529c45f32b15b6b615fe736614b464.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_87529c45f32b15b6b615fe736614b464.json
new file mode 100644
index 0000000000..431b0c56cd
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_87529c45f32b15b6b615fe736614b464.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-c650c7e1-e4b6-422e-b8c8-924b80a20727\",\"object\":\"chat.completion.chunk\",\"created\":1743024460,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5n4afevvvr4s2wf1022mw\"}}\n\ndata: {\"id\":\"chatcmpl-c650c7e1-e4b6-422e-b8c8-924b80a20727\",\"object\":\"chat.completion.chunk\",\"created\":1743024460,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_csng\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hi, world! Bold the text. Link.\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c650c7e1-e4b6-422e-b8c8-924b80a20727\",\"object\":\"chat.completion.chunk\",\"created\":1743024460,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5n4afevvvr4s2wf1022mw\",\"usage\":{\"queue_time\":0.10037805799999999,\"prompt_tokens\":1309,\"prompt_time\":0.09822048,\"completion_tokens\":64,\"completion_time\":0.232727273,\"total_tokens\":1373,\"total_time\":0.330947753}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_63e18d35c3246a288f671a9e4cc8264a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_63e18d35c3246a288f671a9e4cc8264a.json
new file mode 100644
index 0000000000..e038bb4d5e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_63e18d35c3246a288f671a9e4cc8264a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-b849f1e0-eb24-4a43-b606-5df2eedcd4a4\",\"object\":\"chat.completion.chunk\",\"created\":1743024459,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5n3tdevv8ez55y2bs1pqc\"}}\n\ndata: {\"id\":\"chatcmpl-b849f1e0-eb24-4a43-b606-5df2eedcd4a4\",\"object\":\"chat.completion.chunk\",\"created\":1743024460,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_mcsn\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world! Bold text. Link.\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b849f1e0-eb24-4a43-b606-5df2eedcd4a4\",\"object\":\"chat.completion.chunk\",\"created\":1743024460,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5n3tdevv8ez55y2bs1pqc\",\"usage\":{\"queue_time\":0.10292177899999999,\"prompt_tokens\":1303,\"prompt_time\":0.152001793,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":1365,\"total_time\":0.377456338}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_d8c5c9a31d7041ecba8ff4b3429df7d2.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_d8c5c9a31d7041ecba8ff4b3429df7d2.json
new file mode 100644
index 0000000000..eead1c70a6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_d8c5c9a31d7041ecba8ff4b3429df7d2.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-ba6bcbc7-611b-4ba1-aa42-ec51e4493c45\",\"object\":\"chat.completion.chunk\",\"created\":1742837605,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kersbe6xs9vpzteh4v1vp\"}}\n\ndata: {\"id\":\"chatcmpl-ba6bcbc7-611b-4ba1-aa42-ec51e4493c45\",\"object\":\"chat.completion.chunk\",\"created\":1742837605,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_41kr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world! Bold text. Link.\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ba6bcbc7-611b-4ba1-aa42-ec51e4493c45\",\"object\":\"chat.completion.chunk\",\"created\":1742837605,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kersbe6xs9vpzteh4v1vp\",\"usage\":{\"queue_time\":0.13019922499999997,\"prompt_tokens\":1417,\"prompt_time\":0.31976672,\"completion_tokens\":63,\"completion_time\":0.229090909,\"total_tokens\":1480,\"total_time\":0.548857629}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_8c1769196fa40ce8eab1c472c3b07f0d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_8c1769196fa40ce8eab1c472c3b07f0d.json
new file mode 100644
index 0000000000..b06eaf9b9e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_8c1769196fa40ce8eab1c472c3b07f0d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-be09d924-54a7-4200-aedd-ebde62282820\",\"object\":\"chat.completion.chunk\",\"created\":1743024458,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5n2gcfspte2vmmanjjz37\"}}\n\ndata: {\"id\":\"chatcmpl-be09d924-54a7-4200-aedd-ebde62282820\",\"object\":\"chat.completion.chunk\",\"created\":1743024458,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_sq97\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"Jane Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-be09d924-54a7-4200-aedd-ebde62282820\",\"object\":\"chat.completion.chunk\",\"created\":1743024458,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5n2gcfspte2vmmanjjz37\",\"usage\":{\"queue_time\":0.10302385000000001,\"prompt_tokens\":1301,\"prompt_time\":0.093746818,\"completion_tokens\":90,\"completion_time\":0.327272727,\"total_tokens\":1391,\"total_time\":0.421019545}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_a3ed7a6349182a56e0eb61bfef155ea0.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_a3ed7a6349182a56e0eb61bfef155ea0.json
new file mode 100644
index 0000000000..fd1aaac3e3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_a3ed7a6349182a56e0eb61bfef155ea0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-cd3e40fa-064d-4cf6-b23f-7acf081e9bcb\",\"object\":\"chat.completion.chunk\",\"created\":1742837603,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4keq96e6xrnna119athw0r\"}}\n\ndata: {\"id\":\"chatcmpl-cd3e40fa-064d-4cf6-b23f-7acf081e9bcb\",\"object\":\"chat.completion.chunk\",\"created\":1742837604,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_81hf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"Jane Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cd3e40fa-064d-4cf6-b23f-7acf081e9bcb\",\"object\":\"chat.completion.chunk\",\"created\":1742837604,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4keq96e6xrnna119athw0r\",\"usage\":{\"queue_time\":0.137494658,\"prompt_tokens\":1415,\"prompt_time\":0.122057201,\"completion_tokens\":89,\"completion_time\":0.323636364,\"total_tokens\":1504,\"total_time\":0.445693565}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_11632b4d21e1ccbe5dab8525e0243ee6.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_11632b4d21e1ccbe5dab8525e0243ee6.json
new file mode 100644
index 0000000000..a8cbb665ab
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_11632b4d21e1ccbe5dab8525e0243ee6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-cc33a05d-92d8-420a-9f01-736f36484fe4\",\"object\":\"chat.completion.chunk\",\"created\":1743024448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5ms55fskrk0nrpqdz6sed\"}}\n\ndata: {\"id\":\"chatcmpl-cc33a05d-92d8-420a-9f01-736f36484fe4\",\"object\":\"chat.completion.chunk\",\"created\":1743024449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_zwj3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, updated content\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cc33a05d-92d8-420a-9f01-736f36484fe4\",\"object\":\"chat.completion.chunk\",\"created\":1743024449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5ms55fskrk0nrpqdz6sed\",\"usage\":{\"queue_time\":0.10135200200000002,\"prompt_tokens\":1300,\"prompt_time\":0.202782029,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1358,\"total_time\":0.41369112}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_1809f5dac6257a2a042ceae1e9993733.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_1809f5dac6257a2a042ceae1e9993733.json
new file mode 100644
index 0000000000..a29ae9c4bc
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_1809f5dac6257a2a042ceae1e9993733.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-9687daae-46ab-4199-a97c-4b49555ac33a\",\"object\":\"chat.completion.chunk\",\"created\":1742837620,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kf7wde70t11jfq76fcd2c\"}}\n\ndata: {\"id\":\"chatcmpl-9687daae-46ab-4199-a97c-4b49555ac33a\",\"object\":\"chat.completion.chunk\",\"created\":1742837621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_x0th\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, updated content\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-9687daae-46ab-4199-a97c-4b49555ac33a\",\"object\":\"chat.completion.chunk\",\"created\":1742837621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kf7wde70t11jfq76fcd2c\",\"usage\":{\"queue_time\":0.137715459,\"prompt_tokens\":1414,\"prompt_time\":0.234659384,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1472,\"total_time\":0.445568475}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_02495c5c2b87cbe647486eb386496070.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_02495c5c2b87cbe647486eb386496070.json
new file mode 100644
index 0000000000..8464d68f9b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_02495c5c2b87cbe647486eb386496070.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d62b1a2c-e6bb-4b92-8a41-3c40a0ab9a95\",\"object\":\"chat.completion.chunk\",\"created\":1742837601,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kenb3frktgfn2x9j8tak7\"}}\n\ndata: {\"id\":\"chatcmpl-d62b1a2c-e6bb-4b92-8a41-3c40a0ab9a95\",\"object\":\"chat.completion.chunk\",\"created\":1742837602,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_qjny\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"John Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"! How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d62b1a2c-e6bb-4b92-8a41-3c40a0ab9a95\",\"object\":\"chat.completion.chunk\",\"created\":1742837602,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kenb3frktgfn2x9j8tak7\",\"usage\":{\"queue_time\":0.13020971799999997,\"prompt_tokens\":1408,\"prompt_time\":0.163871347,\"completion_tokens\":110,\"completion_time\":0.4,\"total_tokens\":1518,\"total_time\":0.563871347}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_430f0f90f102c041837a61d503ffc81e.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_430f0f90f102c041837a61d503ffc81e.json
new file mode 100644
index 0000000000..e7ba3a8d7d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_430f0f90f102c041837a61d503ffc81e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-30e94a82-d21c-48a5-9cc8-0e7dfee12725\",\"object\":\"chat.completion.chunk\",\"created\":1743024452,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mwaeevrba6z2ss6y89zm\"}}\n\ndata: {\"id\":\"chatcmpl-30e94a82-d21c-48a5-9cc8-0e7dfee12725\",\"object\":\"chat.completion.chunk\",\"created\":1743024452,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_grjm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"John Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"! How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-30e94a82-d21c-48a5-9cc8-0e7dfee12725\",\"object\":\"chat.completion.chunk\",\"created\":1743024452,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mwaeevrba6z2ss6y89zm\",\"usage\":{\"queue_time\":0.10006119000000002,\"prompt_tokens\":1294,\"prompt_time\":0.18286289,\"completion_tokens\":110,\"completion_time\":0.4,\"total_tokens\":1404,\"total_time\":0.58286289}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_1e7fbb3d7dbdc995f68f8ec7cf9ac6d1.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_1e7fbb3d7dbdc995f68f8ec7cf9ac6d1.json
new file mode 100644
index 0000000000..e37167944a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_1e7fbb3d7dbdc995f68f8ec7cf9ac6d1.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-59fc6a2b-2ae5-4189-8d92-1e9b5e83f13d\",\"object\":\"chat.completion.chunk\",\"created\":1743024452,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mx18evrabxpk35rap2q6\"}}\n\ndata: {\"id\":\"chatcmpl-59fc6a2b-2ae5-4189-8d92-1e9b5e83f13d\",\"object\":\"chat.completion.chunk\",\"created\":1743024453,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_yr52\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello! \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"How are you doing?\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-59fc6a2b-2ae5-4189-8d92-1e9b5e83f13d\",\"object\":\"chat.completion.chunk\",\"created\":1743024453,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mx18evrabxpk35rap2q6\",\"usage\":{\"queue_time\":0.100668795,\"prompt_tokens\":1305,\"prompt_time\":0.098004741,\"completion_tokens\":80,\"completion_time\":0.290909091,\"total_tokens\":1385,\"total_time\":0.388913832}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_f8f6040045b5803ae6e5fece75d6ce09.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_f8f6040045b5803ae6e5fece75d6ce09.json
new file mode 100644
index 0000000000..73ae26899c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_f8f6040045b5803ae6e5fece75d6ce09.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-5f3295b7-5738-4650-bd15-56175a792f05\",\"object\":\"chat.completion.chunk\",\"created\":1742837602,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kep2mfrksav14sbzfh936\"}}\n\ndata: {\"id\":\"chatcmpl-5f3295b7-5738-4650-bd15-56175a792f05\",\"object\":\"chat.completion.chunk\",\"created\":1742837602,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_xv0v\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello! \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"How are you doing?\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-5f3295b7-5738-4650-bd15-56175a792f05\",\"object\":\"chat.completion.chunk\",\"created\":1742837602,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kep2mfrksav14sbzfh936\",\"usage\":{\"queue_time\":0.131532902,\"prompt_tokens\":1419,\"prompt_time\":0.105320726,\"completion_tokens\":80,\"completion_time\":0.290909091,\"total_tokens\":1499,\"total_time\":0.396229817}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6d6fa9a53740bc20a8f303d9795904c9.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6d6fa9a53740bc20a8f303d9795904c9.json
new file mode 100644
index 0000000000..53badfcc0e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_6d6fa9a53740bc20a8f303d9795904c9.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-4589a026-fa0a-4ac5-8165-090f455b6e43\",\"object\":\"chat.completion.chunk\",\"created\":1742837604,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4keqxre6zbrcrjzjrc3ck2\"}}\n\ndata: {\"id\":\"chatcmpl-4589a026-fa0a-4ac5-8165-090f455b6e43\",\"object\":\"chat.completion.chunk\",\"created\":1742837604,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_hbdv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"left\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"Jane Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"! How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {\\\"bold\\\": true}}], \\\"children\\\": []}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4589a026-fa0a-4ac5-8165-090f455b6e43\",\"object\":\"chat.completion.chunk\",\"created\":1742837604,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4keqxre6zbrcrjzjrc3ck2\",\"usage\":{\"queue_time\":0.12921857499999997,\"prompt_tokens\":1406,\"prompt_time\":0.133309435,\"completion_tokens\":136,\"completion_time\":0.494545455,\"total_tokens\":1542,\"total_time\":0.62785489}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_a698bedcf41636b7af847c640ca58da5.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_a698bedcf41636b7af847c640ca58da5.json
new file mode 100644
index 0000000000..d559862f44
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_a698bedcf41636b7af847c640ca58da5.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-2ed875c0-cbbf-4565-bf15-fc69982af774\",\"object\":\"chat.completion.chunk\",\"created\":1743024458,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5n325fspt4h354ppnmtgd\"}}\n\ndata: {\"id\":\"chatcmpl-2ed875c0-cbbf-4565-bf15-fc69982af774\",\"object\":\"chat.completion.chunk\",\"created\":1743024459,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_4ff0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"left\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"mention\\\", \\\"props\\\": {\\\"user\\\": \\\"Jane Doe\\\"}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"! How \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"are you doing?\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2ed875c0-cbbf-4565-bf15-fc69982af774\",\"object\":\"chat.completion.chunk\",\"created\":1743024459,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5n325fspt4h354ppnmtgd\",\"usage\":{\"queue_time\":0.10011911600000001,\"prompt_tokens\":1292,\"prompt_time\":0.096718319,\"completion_tokens\":132,\"completion_time\":0.48,\"total_tokens\":1424,\"total_time\":0.576718319}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_2917a476d1fd7b1dc8e35c222f67431b.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_2917a476d1fd7b1dc8e35c222f67431b.json
new file mode 100644
index 0000000000..b7ceaac742
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_2917a476d1fd7b1dc8e35c222f67431b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-4ca9bfab-e711-4923-950e-a93d89a7c386\",\"object\":\"chat.completion.chunk\",\"created\":1742837601,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kemrce6xa02g5xzcgjvtn\"}}\n\ndata: {\"id\":\"chatcmpl-4ca9bfab-e711-4923-950e-a93d89a7c386\",\"object\":\"chat.completion.chunk\",\"created\":1742837601,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_x99a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, updated content\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4ca9bfab-e711-4923-950e-a93d89a7c386\",\"object\":\"chat.completion.chunk\",\"created\":1742837601,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kemrce6xa02g5xzcgjvtn\",\"usage\":{\"queue_time\":0.134167624,\"prompt_tokens\":1414,\"prompt_time\":0.215854158,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1472,\"total_time\":0.426763249}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_dc3d57c44f0c60c55d29a6b23cd8f2ad.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_dc3d57c44f0c60c55d29a6b23cd8f2ad.json
new file mode 100644
index 0000000000..bdeecc56b7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_dc3d57c44f0c60c55d29a6b23cd8f2ad.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-b0fc3d88-8dfb-47f3-b8cc-4d8c0ffa1f82\",\"object\":\"chat.completion.chunk\",\"created\":1743024451,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mvv6fgd9kb9tfytcvp9a\"}}\n\ndata: {\"id\":\"chatcmpl-b0fc3d88-8dfb-47f3-b8cc-4d8c0ffa1f82\",\"object\":\"chat.completion.chunk\",\"created\":1743024451,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_s15e\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, updated content\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b0fc3d88-8dfb-47f3-b8cc-4d8c0ffa1f82\",\"object\":\"chat.completion.chunk\",\"created\":1743024451,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mvv6fgd9kb9tfytcvp9a\",\"usage\":{\"queue_time\":0.09966393700000001,\"prompt_tokens\":1300,\"prompt_time\":0.10478207,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1358,\"total_time\":0.315691161}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_6d82b0009c827f2efc6a36af85580a0a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_6d82b0009c827f2efc6a36af85580a0a.json
new file mode 100644
index 0000000000..22c5673af6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_6d82b0009c827f2efc6a36af85580a0a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-614d8f89-f3f8-4464-8c86-999393893dfa\",\"object\":\"chat.completion.chunk\",\"created\":1742837603,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kepmgfrkspgxqm2cg1k91\"}}\n\ndata: {\"id\":\"chatcmpl-614d8f89-f3f8-4464-8c86-999393893dfa\",\"object\":\"chat.completion.chunk\",\"created\":1742837603,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_51x3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"world!\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-614d8f89-f3f8-4464-8c86-999393893dfa\",\"object\":\"chat.completion.chunk\",\"created\":1742837603,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kepmgfrkspgxqm2cg1k91\",\"usage\":{\"queue_time\":0.128857234,\"prompt_tokens\":1411,\"prompt_time\":0.186439435,\"completion_tokens\":77,\"completion_time\":0.28,\"total_tokens\":1488,\"total_time\":0.466439435}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_9cc478074e29822a2c16f1aef0c91eec.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_9cc478074e29822a2c16f1aef0c91eec.json
new file mode 100644
index 0000000000..09f21a41c2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_9cc478074e29822a2c16f1aef0c91eec.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-4ab0674d-eafc-402d-a8aa-f9a887211a8e\",\"object\":\"chat.completion.chunk\",\"created\":1743024458,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4e32347616\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mxj1evr8qzx2mr60k5rc\"}}\n\ndata: {\"id\":\"chatcmpl-4ab0674d-eafc-402d-a8aa-f9a887211a8e\",\"object\":\"chat.completion.chunk\",\"created\":1743024459,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4e32347616\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_ptrg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, \\\", \\\"styles\\\": {}}, {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"world!\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4ab0674d-eafc-402d-a8aa-f9a887211a8e\",\"object\":\"chat.completion.chunk\",\"created\":1743024459,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4e32347616\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mxj1evr8qzx2mr60k5rc\",\"usage\":{\"queue_time\":5.430239328,\"prompt_tokens\":1297,\"prompt_time\":0.15020392,\"completion_tokens\":77,\"completion_time\":0.28,\"total_tokens\":1374,\"total_time\":0.43020392}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_2818d289627de88f13576fdb050b158b.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_2818d289627de88f13576fdb050b158b.json
new file mode 100644
index 0000000000..64b7777248
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_2818d289627de88f13576fdb050b158b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-de4b227c-5e88-4d37-8851-8e999cbcd91b\",\"object\":\"chat.completion.chunk\",\"created\":1743024450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mv8aevra5jfgj12ncg85\"}}\n\ndata: {\"id\":\"chatcmpl-de4b227c-5e88-4d37-8851-8e999cbcd91b\",\"object\":\"chat.completion.chunk\",\"created\":1743024451,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_khzh\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"right\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's up, world!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-de4b227c-5e88-4d37-8851-8e999cbcd91b\",\"object\":\"chat.completion.chunk\",\"created\":1743024451,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mv8aevra5jfgj12ncg85\",\"usage\":{\"queue_time\":0.101328054,\"prompt_tokens\":1304,\"prompt_time\":0.174980146,\"completion_tokens\":79,\"completion_time\":0.287272727,\"total_tokens\":1383,\"total_time\":0.462252873}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_c1485bbb88f0f7200bea6ac1c009074e.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_c1485bbb88f0f7200bea6ac1c009074e.json
new file mode 100644
index 0000000000..1d051ff576
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_c1485bbb88f0f7200bea6ac1c009074e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-6593604e-fd10-454c-b4c4-f7a4b0ffde99\",\"object\":\"chat.completion.chunk\",\"created\":1742837600,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kem2qe6waw9yk70xjvean\"}}\n\ndata: {\"id\":\"chatcmpl-6593604e-fd10-454c-b4c4-f7a4b0ffde99\",\"object\":\"chat.completion.chunk\",\"created\":1742837600,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_tah2\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"right\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's up, world!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6593604e-fd10-454c-b4c4-f7a4b0ffde99\",\"object\":\"chat.completion.chunk\",\"created\":1742837600,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kem2qe6waw9yk70xjvean\",\"usage\":{\"queue_time\":0.13089486499999997,\"prompt_tokens\":1418,\"prompt_time\":0.237676359,\"completion_tokens\":78,\"completion_time\":0.283636364,\"total_tokens\":1496,\"total_time\":0.521312723}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_6cf486fde639999a6595b63611bf0dce.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_6cf486fde639999a6595b63611bf0dce.json
new file mode 100644
index 0000000000..6536009547
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_6cf486fde639999a6595b63611bf0dce.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-4e72560b-6e38-490c-b96a-3a4e4f87405e\",\"object\":\"chat.completion.chunk\",\"created\":1743024449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mta3evra76mc92bncjd1\"}}\n\ndata: {\"id\":\"chatcmpl-4e72560b-6e38-490c-b96a-3a4e4f87405e\",\"object\":\"chat.completion.chunk\",\"created\":1743024450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_v8j5\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"right\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world!\\\", \\\"styles\\\": {}}]}}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4e72560b-6e38-490c-b96a-3a4e4f87405e\",\"object\":\"chat.completion.chunk\",\"created\":1743024450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mta3evra76mc92bncjd1\",\"usage\":{\"queue_time\":0.09982255,\"prompt_tokens\":1292,\"prompt_time\":0.095857877,\"completion_tokens\":73,\"completion_time\":0.265454545,\"total_tokens\":1365,\"total_time\":0.361312422}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_c00e307d84df70434648a30ee9f8c0bf.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_c00e307d84df70434648a30ee9f8c0bf.json
new file mode 100644
index 0000000000..18523c39a1
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_c00e307d84df70434648a30ee9f8c0bf.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-97d68575-121b-4656-a895-29449a2d2a79\",\"object\":\"chat.completion.chunk\",\"created\":1742837599,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kejqdfrktgtt85rf306y5\"}}\n\ndata: {\"id\":\"chatcmpl-97d68575-121b-4656-a895-29449a2d2a79\",\"object\":\"chat.completion.chunk\",\"created\":1742837599,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_esxv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {\\\"textColor\\\": \\\"default\\\", \\\"backgroundColor\\\": \\\"default\\\", \\\"textAlignment\\\": \\\"right\\\"}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-97d68575-121b-4656-a895-29449a2d2a79\",\"object\":\"chat.completion.chunk\",\"created\":1742837599,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kejqdfrktgtt85rf306y5\",\"usage\":{\"queue_time\":0.129984938,\"prompt_tokens\":1406,\"prompt_time\":0.270604157,\"completion_tokens\":76,\"completion_time\":0.276363636,\"total_tokens\":1482,\"total_time\":0.546967793}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a7b955de0ee71568bfd83df2ec141875.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a7b955de0ee71568bfd83df2ec141875.json
new file mode 100644
index 0000000000..846c46b9ec
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a7b955de0ee71568bfd83df2ec141875.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-63233335-12d8-4cc5-a7b6-961670ba1065\",\"object\":\"chat.completion.chunk\",\"created\":1743024450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mtt6fgd8d42er3pfme5a\"}}\n\ndata: {\"id\":\"chatcmpl-63233335-12d8-4cc5-a7b6-961670ba1065\",\"object\":\"chat.completion.chunk\",\"created\":1743024450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_ey1t\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's up, world!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-63233335-12d8-4cc5-a7b6-961670ba1065\",\"object\":\"chat.completion.chunk\",\"created\":1743024450,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mtt6fgd8d42er3pfme5a\",\"usage\":{\"queue_time\":0.09893120799999999,\"prompt_tokens\":1304,\"prompt_time\":0.099395402,\"completion_tokens\":59,\"completion_time\":0.214545455,\"total_tokens\":1363,\"total_time\":0.313940857}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a823379d44ffe3f008f593747ecad249.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a823379d44ffe3f008f593747ecad249.json
new file mode 100644
index 0000000000..1d6ed416c2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_a823379d44ffe3f008f593747ecad249.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-c1799237-4262-4e5e-b769-baccc659022f\",\"object\":\"chat.completion.chunk\",\"created\":1742837599,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kekdze6vb3ghrvy8ptxbc\"}}\n\ndata: {\"id\":\"chatcmpl-c1799237-4262-4e5e-b769-baccc659022f\",\"object\":\"chat.completion.chunk\",\"created\":1742837600,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_19an\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's up, world!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c1799237-4262-4e5e-b769-baccc659022f\",\"object\":\"chat.completion.chunk\",\"created\":1742837600,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kekdze6vb3ghrvy8ptxbc\",\"usage\":{\"queue_time\":0.131340992,\"prompt_tokens\":1418,\"prompt_time\":0.252058516,\"completion_tokens\":64,\"completion_time\":0.232727273,\"total_tokens\":1482,\"total_time\":0.484785789}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_288beedec80aa4570e242e419b581f53.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_288beedec80aa4570e242e419b581f53.json
new file mode 100644
index 0000000000..b984208ff6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_288beedec80aa4570e242e419b581f53.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-1210b72b-c6f3-4145-bb44-88456a5ea95f\",\"object\":\"chat.completion.chunk\",\"created\":1743024449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mss0evrayf2wq2d6g9f0\"}}\n\ndata: {\"id\":\"chatcmpl-1210b72b-c6f3-4145-bb44-88456a5ea95f\",\"object\":\"chat.completion.chunk\",\"created\":1743024449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_b8zq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1210b72b-c6f3-4145-bb44-88456a5ea95f\",\"object\":\"chat.completion.chunk\",\"created\":1743024449,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mss0evrayf2wq2d6g9f0\",\"usage\":{\"queue_time\":0.101492474,\"prompt_tokens\":1292,\"prompt_time\":0.132297915,\"completion_tokens\":62,\"completion_time\":0.225454545,\"total_tokens\":1354,\"total_time\":0.35775246}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_6e656a17f68109f272dfc5f39519cb30.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_6e656a17f68109f272dfc5f39519cb30.json
new file mode 100644
index 0000000000..503d5a627d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_6e656a17f68109f272dfc5f39519cb30.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-2f63e6b6-2ac4-48d2-a64e-47847f265147\",\"object\":\"chat.completion.chunk\",\"created\":1742837621,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4kf91je70sm6qkv0pj7pfd\"}}\n\ndata: {\"id\":\"chatcmpl-2f63e6b6-2ac4-48d2-a64e-47847f265147\",\"object\":\"chat.completion.chunk\",\"created\":1742837622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_qr9d\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello, world!\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2f63e6b6-2ac4-48d2-a64e-47847f265147\",\"object\":\"chat.completion.chunk\",\"created\":1742837622,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4kf91je70sm6qkv0pj7pfd\",\"usage\":{\"queue_time\":0.130298562,\"prompt_tokens\":1406,\"prompt_time\":0.140155949,\"completion_tokens\":63,\"completion_time\":0.229090909,\"total_tokens\":1469,\"total_time\":0.369246858}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_263762df21d56cd4376f7af2e9b67626.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_263762df21d56cd4376f7af2e9b67626.json
new file mode 100644
index 0000000000..a44199b383
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_263762df21d56cd4376f7af2e9b67626.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfx6jDOS6BJokIJyfpUIq6WMmke0\",\n \"object\": \"chat.completion\",\n \"created\": 1742837556,\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_rE90S6CRYo8vwuS26qP6iuDg\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"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\": 1376,\n \"completion_tokens\": 43,\n \"total_tokens\": 1419,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ca20fd57d92b432e47fdcec0f806f22d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ca20fd57d92b432e47fdcec0f806f22d.json
new file mode 100644
index 0000000000..b34eb14f4b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ca20fd57d92b432e47fdcec0f806f22d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZOTYPs1MbXHgCurc58AKNd1foE\",\n \"object\": \"chat.completion\",\n \"created\": 1743024442,\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_UgaggJfGDyaeg5dytcfc1bVW\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hi, world! Bold the text. Link.\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 968,\n \"completion_tokens\": 47,\n \"total_tokens\": 1015,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_9ab088778a4c7cec250091aa5820a24c.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_9ab088778a4c7cec250091aa5820a24c.json
new file mode 100644
index 0000000000..a9354f8e2d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_9ab088778a4c7cec250091aa5820a24c.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZOah8l32IDGvSUHkBUeaEXI6Ob\",\n \"object\": \"chat.completion\",\n \"created\": 1743024442,\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_rTGeysblGKe4EU39SMnjusac\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"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\": 962,\n \"completion_tokens\": 42,\n \"total_tokens\": 1004,\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_de57b65c90\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fa4d9015e5f38ae323f54cebde3c1200.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fa4d9015e5f38ae323f54cebde3c1200.json
new file mode 100644
index 0000000000..a9c6178ab9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fa4d9015e5f38ae323f54cebde3c1200.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfx4MFyhRWYace8q8ZgWLRoUmsoo\",\n \"object\": \"chat.completion\",\n \"created\": 1742837554,\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_osiMkD0L8wqFRtBdKzCKzwh6\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"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\": 1370,\n \"completion_tokens\": 42,\n \"total_tokens\": 1412,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_9d42d0ec02acb50f6519e29394d67190.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_9d42d0ec02acb50f6519e29394d67190.json
new file mode 100644
index 0000000000..617b41309a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_9d42d0ec02acb50f6519e29394d67190.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfx1TjVxCi5iLVqgMZaMTspz2iWc\",\n \"object\": \"chat.completion\",\n \"created\": 1742837551,\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_O9WoFYknRkRhehLaCHO5c5b4\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"Jane Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"!\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1368,\n \"completion_tokens\": 64,\n \"total_tokens\": 1432,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_ae55d1c480ed80da54334bcf0dfa549e.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_ae55d1c480ed80da54334bcf0dfa549e.json
new file mode 100644
index 0000000000..4d7281f20b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_ae55d1c480ed80da54334bcf0dfa549e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZLwSZgPfj6H8aH4MzESvHWa7ca\",\n \"object\": \"chat.completion\",\n \"created\": 1743024439,\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_7FlxZh6DfBdEuURDag1BjbMh\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"Jane Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"!\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 960,\n \"completion_tokens\": 64,\n \"total_tokens\": 1024,\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_de57b65c90\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_27016ce91939f41b5e9735ce7c22149f.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_27016ce91939f41b5e9735ce7c22149f.json
new file mode 100644
index 0000000000..0a44818638
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_27016ce91939f41b5e9735ce7c22149f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwo6vLN1I00qCYaNOmrkWKZjISW\",\n \"object\": \"chat.completion\",\n \"created\": 1742837538,\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_f3r48jlgpBIzPKW21e241JoH\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, updated content\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1367,\n \"completion_tokens\": 42,\n \"total_tokens\": 1409,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_45ca1ca4007f7963119ee75d2b718e6f.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_45ca1ca4007f7963119ee75d2b718e6f.json
new file mode 100644
index 0000000000..f7b647b649
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_45ca1ca4007f7963119ee75d2b718e6f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSYwgldd4oEN9Gl24S36kAUjC5Dv\",\n \"object\": \"chat.completion\",\n \"created\": 1743024414,\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_GpQOllBlWer3pL4ZIwHDaC14\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, updated content\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 959,\n \"completion_tokens\": 42,\n \"total_tokens\": 1001,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4d68b94a0944a7558b207e31907f7bf9.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4d68b94a0944a7558b207e31907f7bf9.json
new file mode 100644
index 0000000000..b82d480d9b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_4d68b94a0944a7558b207e31907f7bf9.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZC2ZYWotyCQa0Zjs4lCGondi4y\",\n \"object\": \"chat.completion\",\n \"created\": 1743024430,\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_TwAJiixBnHVifWP7R9j4TrMX\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 953,\n \"completion_tokens\": 98,\n \"total_tokens\": 1051,\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_de57b65c90\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_84c2d96f2372a7a7493f9b10df562997.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_84c2d96f2372a7a7493f9b10df562997.json
new file mode 100644
index 0000000000..e93f7651f9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_84c2d96f2372a7a7493f9b10df562997.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwwuXPzk0JW08csUB7WTHJkUYIa\",\n \"object\": \"chat.completion\",\n \"created\": 1742837546,\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_7lQJ86PM5cXp7JJg6hBAzD00\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1361,\n \"completion_tokens\": 80,\n \"total_tokens\": 1441,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_61fe645fbe87c92067aa695b0b6514be.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_61fe645fbe87c92067aa695b0b6514be.json
new file mode 100644
index 0000000000..d1cf0b28df
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_61fe645fbe87c92067aa695b0b6514be.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwyWDVYLKVZdEjapJv4Xb3wb2pt\",\n \"object\": \"chat.completion\",\n \"created\": 1742837548,\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_adVtF7LbBbeSjDS6eY9Ziy4h\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1372,\n \"completion_tokens\": 58,\n \"total_tokens\": 1430,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_ed15d57de86e6645449c32f7312865fd.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_ed15d57de86e6645449c32f7312865fd.json
new file mode 100644
index 0000000000..a46248f43c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_ed15d57de86e6645449c32f7312865fd.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZGM7QgdY4hPP8T0KOgEMu9kCTX\",\n \"object\": \"chat.completion\",\n \"created\": 1743024434,\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_QK50QvrFHKH3fNHtffgHtNpt\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 964,\n \"completion_tokens\": 58,\n \"total_tokens\": 1022,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_2e6811300f1e572981ba1330204657f1.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_2e6811300f1e572981ba1330204657f1.json
new file mode 100644
index 0000000000..76d9fd60a5
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_2e6811300f1e572981ba1330204657f1.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfx2uidnJv9gVCfuRH8CG6brTRpz\",\n \"object\": \"chat.completion\",\n \"created\": 1742837552,\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_ZlbXDVAy2FMyGNM2ZzUuuoYi\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"Jane Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1359,\n \"completion_tokens\": 82,\n \"total_tokens\": 1441,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6ed2ad060906d71a2b5de6d31d3fc099.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6ed2ad060906d71a2b5de6d31d3fc099.json
new file mode 100644
index 0000000000..a061fd117f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_6ed2ad060906d71a2b5de6d31d3fc099.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZNUDG8fklmKPCcr7pu5AorQrbe\",\n \"object\": \"chat.completion\",\n \"created\": 1743024441,\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_fNXsWcIwzIzk9BXEsWY1ddUC\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"Jane Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 951,\n \"completion_tokens\": 100,\n \"total_tokens\": 1051,\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_de57b65c90\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_77716a248954dcda9be2420c1540cea6.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_77716a248954dcda9be2420c1540cea6.json
new file mode 100644
index 0000000000..fe731bb925
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_77716a248954dcda9be2420c1540cea6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwv7f93AD6B3v7hbzIdC8w5yLrT\",\n \"object\": \"chat.completion\",\n \"created\": 1742837545,\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_iE5wVqChImxOanUDuwhsyjjd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, updated content\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1367,\n \"completion_tokens\": 42,\n \"total_tokens\": 1409,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_cfadf5e18860f686098d6db7211b75a5.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_cfadf5e18860f686098d6db7211b75a5.json
new file mode 100644
index 0000000000..304f759499
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_cfadf5e18860f686098d6db7211b75a5.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZB8pKawvMOu70wE6wWOmr6nY50\",\n \"object\": \"chat.completion\",\n \"created\": 1743024429,\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_zvt9NQIYxiqfjzMEUkZAcovd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"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\": 959,\n \"completion_tokens\": 38,\n \"total_tokens\": 997,\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_de57b65c90\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_09cca938032e7bc685d208e4c20dff77.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_09cca938032e7bc685d208e4c20dff77.json
new file mode 100644
index 0000000000..a7f17c2d5c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_09cca938032e7bc685d208e4c20dff77.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwzJ2buzUaalejiG2oUHtP6QOt6\",\n \"object\": \"chat.completion\",\n \"created\": 1742837549,\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_xyqB9q5LTWFuLKLdUiu57PSH\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"world!\\\",\\\"styles\\\":{\\\"bold\\\":true}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1364,\n \"completion_tokens\": 55,\n \"total_tokens\": 1419,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_b4d210d15a248d7fd145b6b44b3ac089.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_b4d210d15a248d7fd145b6b44b3ac089.json
new file mode 100644
index 0000000000..dd5766601b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_b4d210d15a248d7fd145b6b44b3ac089.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZK5sW65iBmSNzGL87SDtXZx50x\",\n \"object\": \"chat.completion\",\n \"created\": 1743024438,\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_aSnLOXJvasXy15rvUJxdTdGY\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"world!\\\",\\\"styles\\\":{\\\"bold\\\":true}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 956,\n \"completion_tokens\": 73,\n \"total_tokens\": 1029,\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_de57b65c90\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_1231df197854d9b16146272a357d41ad.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_1231df197854d9b16146272a357d41ad.json
new file mode 100644
index 0000000000..22beb3d2cc
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_1231df197854d9b16146272a357d41ad.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZ7hh4xeVsueNlFz4xSYT2rc7eE\",\n \"object\": \"chat.completion\",\n \"created\": 1743024425,\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_z5lhsLuIATCAwEVdBWQzCh0b\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"What's up, world!\\\",\\\"styles\\\":{}}],\\\"props\\\":{\\\"textAlignment\\\":\\\"right\\\"}}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 962,\n \"completion_tokens\": 50,\n \"total_tokens\": 1012,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_4a1f3d33a93ed5ffbcf71abab305d938.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_4a1f3d33a93ed5ffbcf71abab305d938.json
new file mode 100644
index 0000000000..4b8672fad8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_4a1f3d33a93ed5ffbcf71abab305d938.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwuV2EIQTnop8OIzrzaapqfdZgY\",\n \"object\": \"chat.completion\",\n \"created\": 1742837544,\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_IoIVrJAYX7Tpuph1Nk4cQPiP\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"What's up, world!\\\",\\\"styles\\\":{}}],\\\"props\\\":{\\\"textAlignment\\\":\\\"right\\\"}}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1370,\n \"completion_tokens\": 50,\n \"total_tokens\": 1420,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_05aba72ad76a0e1776feb6353b49827f.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_05aba72ad76a0e1776feb6353b49827f.json
new file mode 100644
index 0000000000..d49868cdb9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_05aba72ad76a0e1776feb6353b49827f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZ1ykfMbYkQf554pZAYXSr7UdBJ\",\n \"object\": \"chat.completion\",\n \"created\": 1743024419,\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_PO7Wvr473Vzmj6znYeV1nwKf\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textAlignment\\\":\\\"right\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 951,\n \"completion_tokens\": 50,\n \"total_tokens\": 1001,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_f942259994d5357be27faf9f5299f1c7.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_f942259994d5357be27faf9f5299f1c7.json
new file mode 100644
index 0000000000..443fda55fe
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_f942259994d5357be27faf9f5299f1c7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwrAeLP7t5XGxSKYZ3lTZjA7K7E\",\n \"object\": \"chat.completion\",\n \"created\": 1742837541,\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_f37yz9kGann0DO5Hf9BdyxoM\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"right\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1359,\n \"completion_tokens\": 60,\n \"total_tokens\": 1419,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_6ec83003ad\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_105972683a1cc5045429a9c84d773468.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_105972683a1cc5045429a9c84d773468.json
new file mode 100644
index 0000000000..8066ffcbea
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_105972683a1cc5045429a9c84d773468.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwsViLXL5OvplF36NxCcRdQAZVc\",\n \"object\": \"chat.completion\",\n \"created\": 1742837542,\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_BnLC7FCYeug7u2YCs7pHvSzN\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"heading\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"What's up, world!\\\"}],\\\"props\\\":{\\\"level\\\":1}}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1370,\n \"completion_tokens\": 45,\n \"total_tokens\": 1415,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1280,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_f20759f205aa2d3531c468d512e09b61.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_f20759f205aa2d3531c468d512e09b61.json
new file mode 100644
index 0000000000..883411643f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_f20759f205aa2d3531c468d512e09b61.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSZ6KrTYCd9kzLv7X30LRYZfarFq\",\n \"object\": \"chat.completion\",\n \"created\": 1743024424,\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_V3oTPA5G6rEruauq8hKK48gM\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"heading\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"What's up, world!\\\"}],\\\"props\\\":{\\\"level\\\":1}}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 962,\n \"completion_tokens\": 45,\n \"total_tokens\": 1007,\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_de57b65c90\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_2825bcf1ef36322e774773af28218c58.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_2825bcf1ef36322e774773af28218c58.json
new file mode 100644
index 0000000000..9d512b7150
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_2825bcf1ef36322e774773af28218c58.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSYzLTSx3BVDDKECVStBoYlYlJjC\",\n \"object\": \"chat.completion\",\n \"created\": 1743024417,\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_lmTxAroMIxiJQZZjUAv4cAM1\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"heading\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"props\\\":{\\\"level\\\":1}}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 951,\n \"completion_tokens\": 48,\n \"total_tokens\": 999,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_28def06e7990bb7a50bb4985830c7965.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_28def06e7990bb7a50bb4985830c7965.json
new file mode 100644
index 0000000000..5519b3e778
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_28def06e7990bb7a50bb4985830c7965.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEfwpIOs6p9IQbbHVv7Ix7Dv90Jp2\",\n \"object\": \"chat.completion\",\n \"created\": 1742837539,\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_o6RVWJZniejDTCu3kDYAOtyC\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":{\\\"type\\\":\\\"heading\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"props\\\":{\\\"level\\\":1}}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1359,\n \"completion_tokens\": 48,\n \"total_tokens\": 1407,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_569a794ae4dfed4b89911cce56987a13.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_569a794ae4dfed4b89911cce56987a13.json
new file mode 100644
index 0000000000..661b1ca7cc
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_569a794ae4dfed4b89911cce56987a13.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_35tJwORoWRDIGIcWU3IZi09F\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxXjxmv9n8Z0JgFKyVK59bGL2sS\",\"object\":\"chat.completion.chunk\",\"created\":1742837583,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_dbf60c53bfc13b9b3a2df7353aa61f87.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_dbf60c53bfc13b9b3a2df7353aa61f87.json
new file mode 100644
index 0000000000..60463e36c7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_dbf60c53bfc13b9b3a2df7353aa61f87.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_6yVhKha9IxKJm6buJGLTjU9Z\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYmbPOKUn7b0xuaJYwbKnaRAHW5\",\"object\":\"chat.completion.chunk\",\"created\":1743024404,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_393e3182eb75c9f8bcf2e86a984e2e50.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_393e3182eb75c9f8bcf2e86a984e2e50.json
new file mode 100644
index 0000000000..b0c54f53a8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_393e3182eb75c9f8bcf2e86a984e2e50.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_8EWvf6NDVsK3EbcB8xrphP1Y\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxVokKd7NeuyD1g7r1qOze3parw\",\"object\":\"chat.completion.chunk\",\"created\":1742837581,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_bdb34d774eb45113ffb222c038160093.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_bdb34d774eb45113ffb222c038160093.json
new file mode 100644
index 0000000000..435e2345d5
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_bdb34d774eb45113ffb222c038160093.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_H3iIaVuyGHu7FreknGSiQFoe\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYlO6WwvT0WGthKN9cHJ095ROhP\",\"object\":\"chat.completion.chunk\",\"created\":1743024403,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_262fc0ea8edc96b65468c113bac7d7b2.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_262fc0ea8edc96b65468c113bac7d7b2.json
new file mode 100644
index 0000000000..3d8c6e4817
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_262fc0ea8edc96b65468c113bac7d7b2.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_7vb8ZHZev6UpNDwHQvphsegg\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxQ30BBMdPZnfup571I0yMUaAMm\",\"object\":\"chat.completion.chunk\",\"created\":1742837576,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_a27a158f4829d6b53b537aaf7f087fb1.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_a27a158f4829d6b53b537aaf7f087fb1.json
new file mode 100644
index 0000000000..7b475504ae
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_a27a158f4829d6b53b537aaf7f087fb1.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_0v6GAuurxbzoBSHJXrvHHmus\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYi5QP7zUlSZcYXLXgv5lx8lJ6U\",\"object\":\"chat.completion.chunk\",\"created\":1743024400,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_121334d5f35f095e4adf175663b7e538.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_121334d5f35f095e4adf175663b7e538.json
new file mode 100644
index 0000000000..d6e6faa6f0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_121334d5f35f095e4adf175663b7e538.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_KsaqUNh9LQnpZrKDiFUvKwZr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYUGMW164wKPimai9UdCEc61pPq\",\"object\":\"chat.completion.chunk\",\"created\":1743024386,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_20955338e59a6eef09e2e3af32d7e9bc.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_20955338e59a6eef09e2e3af32d7e9bc.json
new file mode 100644
index 0000000000..b57b7aec70
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_20955338e59a6eef09e2e3af32d7e9bc.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Bd1p88KtBVP6wmAWP8WozBIT\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxBPcp72QoQ7vWtrnDo9loDB58O\",\"object\":\"chat.completion.chunk\",\"created\":1742837561,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_69c631d2133ca0644e9974f8d8959e4b.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_69c631d2133ca0644e9974f8d8959e4b.json
new file mode 100644
index 0000000000..d6a28ade3c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_69c631d2133ca0644e9974f8d8959e4b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ENsyxKSQkG161ZZA5t38A4ns\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYctGDrFgqfqpCkJet345INzBvh\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_b15519ede62f4cdd6439ab044fb497ac.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_b15519ede62f4cdd6439ab044fb497ac.json
new file mode 100644
index 0000000000..7d31b3b215
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_b15519ede62f4cdd6439ab044fb497ac.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_T06DkeKksXWfgwkyHg3sZAF3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxMzvP7CL0jiMizQXiz5QLR01da\",\"object\":\"chat.completion.chunk\",\"created\":1742837572,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_9c0091d18c80f465d33a5002fe37eee0.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_9c0091d18c80f465d33a5002fe37eee0.json
new file mode 100644
index 0000000000..f983d50a0c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_9c0091d18c80f465d33a5002fe37eee0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_KFghNbNe2NMGcH8QCnZpyqDi\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxOsIOauyzo3J0WmHKxpyHWZ6NX\",\"object\":\"chat.completion.chunk\",\"created\":1742837574,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_aca5b9c4101d93810ff5d2d06a67d00a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_aca5b9c4101d93810ff5d2d06a67d00a.json
new file mode 100644
index 0000000000..2615589977
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_aca5b9c4101d93810ff5d2d06a67d00a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Hx58jIBAN0ChrQPX3wgJRCEW\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYePYaIVpcIuCav3eBg8w4ERvKe\",\"object\":\"chat.completion.chunk\",\"created\":1743024396,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_7263bee37047b5c4d3acf03898c3cb1d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_7263bee37047b5c4d3acf03898c3cb1d.json
new file mode 100644
index 0000000000..ea8a9a77ed
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_7263bee37047b5c4d3acf03898c3cb1d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_9nGHzlOzYgGgDQIFIrciqfmu\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxTVG0uaEpM5znOkF1WIMvFWK1j\",\"object\":\"chat.completion.chunk\",\"created\":1742837579,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_c4d8517a64319403b3224a18bf0e3d91.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_c4d8517a64319403b3224a18bf0e3d91.json
new file mode 100644
index 0000000000..c908bdd168
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_c4d8517a64319403b3224a18bf0e3d91.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_bZ5OAKA23gSEMBN1qdCIsPO6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"default\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"background\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"default\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Alignment\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"left\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"user\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYjnkRYmQTBbbDJ1DFLXvqf1zpX\",\"object\":\"chat.completion.chunk\",\"created\":1743024401,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_48da30a3caeee16b27077166df27dd3b.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_48da30a3caeee16b27077166df27dd3b.json
new file mode 100644
index 0000000000..d0cdd9f33b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_48da30a3caeee16b27077166df27dd3b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_tq36aLz2craEGGdAWprNzuvY\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxKWCSXVCCFBJAN52VUH6sDFWma\",\"object\":\"chat.completion.chunk\",\"created\":1742837570,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_d31958012179cecbcb3bc2c4e702e9a2.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_d31958012179cecbcb3bc2c4e702e9a2.json
new file mode 100644
index 0000000000..39674654e3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_d31958012179cecbcb3bc2c4e702e9a2.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_nDSskH8TGRXNbnng5Pd9mSsi\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYciOSjfdgsOvG7UB0BV18paCnS\",\"object\":\"chat.completion.chunk\",\"created\":1743024394,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_372e8c65dd7aef186ff9a72a8d62cfe0.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_372e8c65dd7aef186ff9a72a8d62cfe0.json
new file mode 100644
index 0000000000..9459ccdaa9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_372e8c65dd7aef186ff9a72a8d62cfe0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_GvggoGXinNrlK0ttYGdUr1Ik\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxPs2lQsmakD049Zamp7FVSN7YJ\",\"object\":\"chat.completion.chunk\",\"created\":1742837575,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_b8b3727e18b9f676ae4cf68788b4169d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_b8b3727e18b9f676ae4cf68788b4169d.json
new file mode 100644
index 0000000000..d75975e470
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_b8b3727e18b9f676ae4cf68788b4169d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_rKMj2xRhODq677m4R74m3gYz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYf7Wfyn2J5XHpVF8pNiEPKdGpC\",\"object\":\"chat.completion.chunk\",\"created\":1743024397,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_b3d77e99ef033ae34baef748edd2a7bb.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_b3d77e99ef033ae34baef748edd2a7bb.json
new file mode 100644
index 0000000000..d3af1cdc0a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_b3d77e99ef033ae34baef748edd2a7bb.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_RVGJm7jQ2Q5WRfui2873jCP0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"],\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Alignment\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"right\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYaWZD50kf7l3naRJ5oZhu1fwbh\",\"object\":\"chat.completion.chunk\",\"created\":1743024392,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_bfc343e0796bc095f79ac8a33932c5c7.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_bfc343e0796bc095f79ac8a33932c5c7.json
new file mode 100644
index 0000000000..85920304cf
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_bfc343e0796bc095f79ac8a33932c5c7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_lDmFvzaWVfNI8U36Kkyc6U7A\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"],\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Alignment\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"right\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxJikaDGeMxfFHqFGeJtM9xFxpZ\",\"object\":\"chat.completion.chunk\",\"created\":1742837569,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_806b30428c843e34cb5a65fac87d0f8d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_806b30428c843e34cb5a65fac87d0f8d.json
new file mode 100644
index 0000000000..e9f100e3e9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_806b30428c843e34cb5a65fac87d0f8d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_mHkyuBcwegMP6Z0lstTZ9k8k\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Alignment\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"right\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxEfOxsEAAPO0TkAvQ1Br9toy5D\",\"object\":\"chat.completion.chunk\",\"created\":1742837564,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_a7a36bddd00c8fd378990ec14e778af3.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_a7a36bddd00c8fd378990ec14e778af3.json
new file mode 100644
index 0000000000..1930c3321a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_a7a36bddd00c8fd378990ec14e778af3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Lo4KHQlehWIwinklz6DjhmhV\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Alignment\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"right\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYWT7nUzod8VixhHCdy60zL9C8N\",\"object\":\"chat.completion.chunk\",\"created\":1743024388,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_1162da2d1315198cab76c459c162ef5a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_1162da2d1315198cab76c459c162ef5a.json
new file mode 100644
index 0000000000..d923fa45fb
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_1162da2d1315198cab76c459c162ef5a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_z9MQbjTOTLvKvsLorbWyXnn2\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"heading\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"],\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"level\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYY3tGuUVfROUgIn6N8ob17MYQE\",\"object\":\"chat.completion.chunk\",\"created\":1743024390,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_8e67aacd7bd7174051eb89c4ef8c2155.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_8e67aacd7bd7174051eb89c4ef8c2155.json
new file mode 100644
index 0000000000..31d849f96c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_8e67aacd7bd7174051eb89c4ef8c2155.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_vRUURiUCm8IJIsWqF5sFSta7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"heading\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"],\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"level\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxGOYhitmLa1wNzGQMO2jVe8UeY\",\"object\":\"chat.completion.chunk\",\"created\":1742837566,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_084e1ca091378e1398b9ad104a18c463.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_084e1ca091378e1398b9ad104a18c463.json
new file mode 100644
index 0000000000..84737bfd50
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_084e1ca091378e1398b9ad104a18c463.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_NX32L4k1PbgoJ44TqqNxNp1e\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"heading\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"],\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"level\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEfxCD1eN0ZpMbLUp8iQr3p2iSLqS\",\"object\":\"chat.completion.chunk\",\"created\":1742837562,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_5787b8ef35848cf0e5ba0e183ca14ff8.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_5787b8ef35848cf0e5ba0e183ca14ff8.json
new file mode 100644
index 0000000000..c46187c0de
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_5787b8ef35848cf0e5ba0e183ca14ff8.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world!\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"mention\\\",\\\"props\\\":{\\\"user\\\":\\\"John Doe\\\"}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"! How \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"are you doing?\\\",\\\"styles\\\":{\\\"bold\\\":true}}],\\\"children\\\":[]},{\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello, world! \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text. \\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"link\\\",\\\"href\\\":\\\"https://www.google.com\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Link.\\\",\\\"styles\\\":{}}]}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mention\"]},\"props\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_FdQvgsghgzJmk3mZ1ThjOnRD\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"heading\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"],\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"level\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYVL4gB0V93jmctmQwhi7XciHbz\",\"object\":\"chat.completion.chunk\",\"created\":1743024387,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_de57b65c90\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_734289463570fcb06287961d207d870f.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_734289463570fcb06287961d207d870f.json
new file mode 100644
index 0000000000..64af5422aa
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_734289463570fcb06287961d207d870f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-6d233815-4ac6-4944-972c-de32b9842cb0\",\"object\":\"chat.completion\",\"created\":1743024468,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_gbv1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":6.102621684,\"prompt_tokens\":1106,\"prompt_time\":0.185001034,\"completion_tokens\":59,\"completion_time\":0.214545455,\"total_tokens\":1165,\"total_time\":0.399546489},\"system_fingerprint\":\"fp_fcc3b74982\",\"x_groq\":{\"id\":\"req_01jqa5n6kcevwbxyhdcx4m1eck\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_eb0928df1870ddb8356c7deb819490e3.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_eb0928df1870ddb8356c7deb819490e3.json
new file mode 100644
index 0000000000..15a739ed0a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_eb0928df1870ddb8356c7deb819490e3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-d036aa6b-843d-4a60-af28-6d9c130ec94d\",\"object\":\"chat.completion\",\"created\":1742831991,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_ps5q\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10133316099999999,\"prompt_tokens\":1220,\"prompt_time\":0.090242633,\"completion_tokens\":59,\"completion_time\":0.214545455,\"total_tokens\":1279,\"total_time\":0.304788088},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jq4e3f1zf2saxf3dz7nkmq24\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_ae5ac9e8590e03fa659b80a3a2d1b8f4.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_ae5ac9e8590e03fa659b80a3a2d1b8f4.json
new file mode 100644
index 0000000000..873805790b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_ae5ac9e8590e03fa659b80a3a2d1b8f4.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-4a6f04e0-1059-4551-a29c-f24b6ca90c55\",\"object\":\"chat.completion\",\"created\":1743024468,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_qk01\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.7407051659999999,\"prompt_tokens\":1105,\"prompt_time\":0.148843911,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":1162,\"total_time\":0.356116638},\"system_fingerprint\":\"fp_3884478861\",\"x_groq\":{\"id\":\"req_01jqa5nbggfsva18ddkbgm3zef\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_efbf165f581aec8176c8f175256d2237.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_efbf165f581aec8176c8f175256d2237.json
new file mode 100644
index 0000000000..0d90a872f9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_efbf165f581aec8176c8f175256d2237.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-333a8116-fb32-46f7-8f11-5756085bc4ce\",\"object\":\"chat.completion\",\"created\":1742831992,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_73gv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10077185200000001,\"prompt_tokens\":1219,\"prompt_time\":0.086337296,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":1276,\"total_time\":0.293610023},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jq4e3fpsejdstykf2yn0dj1k\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_d65a78ff7559ef9581ca888f64474926.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_d65a78ff7559ef9581ca888f64474926.json
new file mode 100644
index 0000000000..067c46a36a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_d65a78ff7559ef9581ca888f64474926.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-54c8da98-12fa-4477-a159-5c17bf122402\",\"object\":\"chat.completion\",\"created\":1742831993,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_dvny\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" world\\\",\\\"styles\\\":{}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10111422199999999,\"prompt_tokens\":1176,\"prompt_time\":0.083260654,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":1233,\"total_time\":0.290533381},\"system_fingerprint\":\"fp_8dd9fca28c\",\"x_groq\":{\"id\":\"req_01jq4e3ge8f2vtt5zmf0fnwpfp\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_edb25d924f0628eda240d4deeaf8ccc6.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_edb25d924f0628eda240d4deeaf8ccc6.json
new file mode 100644
index 0000000000..741381c1a3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_edb25d924f0628eda240d4deeaf8ccc6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-4c203f51-9f40-46da-a809-592fada61c2b\",\"object\":\"chat.completion\",\"created\":1743024468,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_6s4d\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" world\\\",\\\"styles\\\":{}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10256454900000002,\"prompt_tokens\":1062,\"prompt_time\":0.080259983,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":1119,\"total_time\":0.28753271},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jqa5ncm8evzrr5rqd1mrkh2y\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_4c608efd0eb2751370fb87035374fd2f.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_4c608efd0eb2751370fb87035374fd2f.json
new file mode 100644
index 0000000000..0ab097968c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_4c608efd0eb2751370fb87035374fd2f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-051b1c8f-d844-4825-aab9-29201cbedfe0\",\"object\":\"chat.completion\",\"created\":1742831990,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_qg77\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hallo\\\", \\\"styles\\\": {}}]}}, {\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Welt\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10118516000000001,\"prompt_tokens\":1219,\"prompt_time\":0.093699398,\"completion_tokens\":102,\"completion_time\":0.370909091,\"total_tokens\":1321,\"total_time\":0.464608489},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jq4e3dsrf2rbyvjn9v0yqp9z\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_af07e3e765c289be7340c288db29f87a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_af07e3e765c289be7340c288db29f87a.json
new file mode 100644
index 0000000000..2b382a2b90
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_af07e3e765c289be7340c288db29f87a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-ae7c107f-aef9-455d-9c64-ede4dd1bac55\",\"object\":\"chat.completion\",\"created\":1743024461,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_4xek\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hallo\\\", \\\"styles\\\": {}}]}}, {\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Welt\\\", \\\"styles\\\": {}}]}}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10054699,\"prompt_tokens\":1105,\"prompt_time\":0.079302014,\"completion_tokens\":102,\"completion_time\":0.370909091,\"total_tokens\":1207,\"total_time\":0.450211105},\"system_fingerprint\":\"fp_34555b7c20\",\"x_groq\":{\"id\":\"req_01jqa5n60jfgdtj33pv3cgn8dq\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_2fb7b05feb9a680447e61d914cb7114d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_2fb7b05feb9a680447e61d914cb7114d.json
new file mode 100644
index 0000000000..d258a47cf4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_2fb7b05feb9a680447e61d914cb7114d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-deccccbf-737d-4c06-a6fb-4472807b8ed8\",\"object\":\"chat.completion.chunk\",\"created\":1742832019,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4e49k7em1bdr07pkxm1fx1\"}}\n\ndata: {\"id\":\"chatcmpl-deccccbf-737d-4c06-a6fb-4472807b8ed8\",\"object\":\"chat.completion.chunk\",\"created\":1742832019,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_8k68\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-deccccbf-737d-4c06-a6fb-4472807b8ed8\",\"object\":\"chat.completion.chunk\",\"created\":1742832019,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4e49k7em1bdr07pkxm1fx1\",\"usage\":{\"queue_time\":0.10210154200000002,\"prompt_tokens\":1220,\"prompt_time\":0.086570764,\"completion_tokens\":59,\"completion_time\":0.214545455,\"total_tokens\":1279,\"total_time\":0.301116219}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_d5cf54656e101620fb574ea580b3713d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_d5cf54656e101620fb574ea580b3713d.json
new file mode 100644
index 0000000000..2e623eb015
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_d5cf54656e101620fb574ea580b3713d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-8f9dc0e5-ece9-4b05-9189-5800e9368b8d\",\"object\":\"chat.completion.chunk\",\"created\":1743024447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mqtsevpbq1n5besj0m03\"}}\n\ndata: {\"id\":\"chatcmpl-8f9dc0e5-ece9-4b05-9189-5800e9368b8d\",\"object\":\"chat.completion.chunk\",\"created\":1743024447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_2cp9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"heading\\\", \\\"props\\\": {\\\"level\\\": 1}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8f9dc0e5-ece9-4b05-9189-5800e9368b8d\",\"object\":\"chat.completion.chunk\",\"created\":1743024447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mqtsevpbq1n5besj0m03\",\"usage\":{\"queue_time\":0.09945562500000002,\"prompt_tokens\":1106,\"prompt_time\":0.10249043,\"completion_tokens\":59,\"completion_time\":0.214545455,\"total_tokens\":1165,\"total_time\":0.317035885}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_7bfd349b1b5457d69c7157dd35f319f9.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_7bfd349b1b5457d69c7157dd35f319f9.json
new file mode 100644
index 0000000000..e2ebe61056
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_7bfd349b1b5457d69c7157dd35f319f9.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-da591da2-103b-48fc-89e9-bc2c0c3829ad\",\"object\":\"chat.completion.chunk\",\"created\":1743024447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mra6evpvjep190cx71rn\"}}\n\ndata: {\"id\":\"chatcmpl-da591da2-103b-48fc-89e9-bc2c0c3829ad\",\"object\":\"chat.completion.chunk\",\"created\":1743024448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_t6zy\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-da591da2-103b-48fc-89e9-bc2c0c3829ad\",\"object\":\"chat.completion.chunk\",\"created\":1743024448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mra6evpvjep190cx71rn\",\"usage\":{\"queue_time\":0.10271153999999999,\"prompt_tokens\":1105,\"prompt_time\":0.084419085,\"completion_tokens\":58,\"completion_time\":0.210909091,\"total_tokens\":1163,\"total_time\":0.295328176}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_efd36f5b40f473dfd2eb537da0259fe3.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_efd36f5b40f473dfd2eb537da0259fe3.json
new file mode 100644
index 0000000000..89941c9d4e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_efd36f5b40f473dfd2eb537da0259fe3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-a4b29c7e-ab2e-4053-b9e1-5c305dfb4088\",\"object\":\"chat.completion.chunk\",\"created\":1742832019,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4e4a8je0jtmj5mzy5avxe2\"}}\n\ndata: {\"id\":\"chatcmpl-a4b29c7e-ab2e-4053-b9e1-5c305dfb4088\",\"object\":\"chat.completion.chunk\",\"created\":1742832020,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_atwn\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hello\\\", \\\"styles\\\": {\\\"bold\\\": true}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a4b29c7e-ab2e-4053-b9e1-5c305dfb4088\",\"object\":\"chat.completion.chunk\",\"created\":1742832020,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4e4a8je0jtmj5mzy5avxe2\",\"usage\":{\"queue_time\":0.130077693,\"prompt_tokens\":1219,\"prompt_time\":0.086671721,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":1276,\"total_time\":0.293944448}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_1ca2bc75c520f802b72600de4d16ad6d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_1ca2bc75c520f802b72600de4d16ad6d.json
new file mode 100644
index 0000000000..24382842ba
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_1ca2bc75c520f802b72600de4d16ad6d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-11600056-23d9-4182-a762-17b88206b28a\",\"object\":\"chat.completion.chunk\",\"created\":1743024448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mrqxevqbv3fz4vcmqc65\"}}\n\ndata: {\"id\":\"chatcmpl-11600056-23d9-4182-a762-17b88206b28a\",\"object\":\"chat.completion.chunk\",\"created\":1743024448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_pvym\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" world\\\",\\\"styles\\\":{}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-11600056-23d9-4182-a762-17b88206b28a\",\"object\":\"chat.completion.chunk\",\"created\":1743024448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mrqxevqbv3fz4vcmqc65\",\"usage\":{\"queue_time\":0.107885802,\"prompt_tokens\":1062,\"prompt_time\":0.075850843,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":1119,\"total_time\":0.28312357}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_9ab6ea70a6bdd7d54b8ee3268e395e29.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_9ab6ea70a6bdd7d54b8ee3268e395e29.json
new file mode 100644
index 0000000000..d3da16d941
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_9ab6ea70a6bdd7d54b8ee3268e395e29.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-579e2cb1-ea21-45b9-a6e2-12087e04a26d\",\"object\":\"chat.completion.chunk\",\"created\":1742832020,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4e4b0tem2t2tyq45w4sm65\"}}\n\ndata: {\"id\":\"chatcmpl-579e2cb1-ea21-45b9-a6e2-12087e04a26d\",\"object\":\"chat.completion.chunk\",\"created\":1742832020,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_ysd6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" world\\\",\\\"styles\\\":{}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-579e2cb1-ea21-45b9-a6e2-12087e04a26d\",\"object\":\"chat.completion.chunk\",\"created\":1742832020,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4e4b0tem2t2tyq45w4sm65\",\"usage\":{\"queue_time\":0.102125676,\"prompt_tokens\":1176,\"prompt_time\":0.091100342,\"completion_tokens\":57,\"completion_time\":0.207272727,\"total_tokens\":1233,\"total_time\":0.298373069}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_15f878bec801eba951e0053897b778d7.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_15f878bec801eba951e0053897b778d7.json
new file mode 100644
index 0000000000..b9310b3473
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_15f878bec801eba951e0053897b778d7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-a3b982e9-a035-422f-8ac5-0490761a77fa\",\"object\":\"chat.completion.chunk\",\"created\":1743024446,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jqa5mq89evp8zh075evxf3cx\"}}\n\ndata: {\"id\":\"chatcmpl-a3b982e9-a035-422f-8ac5-0490761a77fa\",\"object\":\"chat.completion.chunk\",\"created\":1743024447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_cnxz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hallo\\\", \\\"styles\\\": {}}]}}, {\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Welt\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-a3b982e9-a035-422f-8ac5-0490761a77fa\",\"object\":\"chat.completion.chunk\",\"created\":1743024447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_8dd9fca28c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jqa5mq89evp8zh075evxf3cx\",\"usage\":{\"queue_time\":0.10017536399999999,\"prompt_tokens\":1105,\"prompt_time\":0.078397034,\"completion_tokens\":102,\"completion_time\":0.370909091,\"total_tokens\":1207,\"total_time\":0.449306125}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_76a6026a80045b9b8db3e51557d6680d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_76a6026a80045b9b8db3e51557d6680d.json
new file mode 100644
index 0000000000..c2f9c070a0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_76a6026a80045b9b8db3e51557d6680d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-10dd23f9-b199-4e9a-99c0-ea93dd30ffc7\",\"object\":\"chat.completion.chunk\",\"created\":1742832017,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq4e481ee0hb88b0hw40c0x5\"}}\n\ndata: {\"id\":\"chatcmpl-10dd23f9-b199-4e9a-99c0-ea93dd30ffc7\",\"object\":\"chat.completion.chunk\",\"created\":1742832017,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_2j91\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Hallo\\\", \\\"styles\\\": {}}]}}, {\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"1$\\\", \\\"block\\\": {\\\"type\\\": \\\"paragraph\\\", \\\"props\\\": {}, \\\"content\\\": [{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Welt\\\", \\\"styles\\\": {}}]}}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-10dd23f9-b199-4e9a-99c0-ea93dd30ffc7\",\"object\":\"chat.completion.chunk\",\"created\":1742832017,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq4e481ee0hb88b0hw40c0x5\",\"usage\":{\"queue_time\":0.101375873,\"prompt_tokens\":1219,\"prompt_time\":0.087391309,\"completion_tokens\":102,\"completion_time\":0.370909091,\"total_tokens\":1321,\"total_time\":0.4583004}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_133a3b9af303437cc1597a7c587ce188.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_133a3b9af303437cc1597a7c587ce188.json
new file mode 100644
index 0000000000..ec5f758fab
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_133a3b9af303437cc1597a7c587ce188.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSYr9JRdSGIbYAqc7GA7rmDjmsOo\",\n \"object\": \"chat.completion\",\n \"created\": 1743024409,\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_RV1yEymDTkfk5cJsFiRNfegv\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"heading\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"props\\\":{\\\"level\\\":1}}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 688,\n \"completion_tokens\": 44,\n \"total_tokens\": 732,\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_4ecdfc8cdc\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_6c758ed1459d6b5d4861110f89a9959a.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_6c758ed1459d6b5d4861110f89a9959a.json
new file mode 100644
index 0000000000..74a0409c69
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_6c758ed1459d6b5d4861110f89a9959a.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEeATPi7DmNqMpKNkGxG4eGn7Ql9w\",\n \"object\": \"chat.completion\",\n \"created\": 1742830697,\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_lQwMWpAHbsBdNpX7AGzQwuCG\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"heading\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"props\\\":{\\\"level\\\":1}}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1096,\n \"completion_tokens\": 44,\n \"total_tokens\": 1140,\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_83df987f64\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_d8d489444ed28af56900134eccc1ccab.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_d8d489444ed28af56900134eccc1ccab.json
new file mode 100644
index 0000000000..3bf45b1778
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_d8d489444ed28af56900134eccc1ccab.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSYsAeP5bKvlpxLzc9MYvu8hQ9ve\",\n \"object\": \"chat.completion\",\n \"created\": 1743024410,\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_GQeWL3PPt5WDxPEulV0FYzlB\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{\\\"bold\\\":true}}]}}]}\"\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\": 40,\n \"total_tokens\": 727,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_fa0f4aedeaf9181a5fff03af24a048a0.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_fa0f4aedeaf9181a5fff03af24a048a0.json
new file mode 100644
index 0000000000..12b2b429bb
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_fa0f4aedeaf9181a5fff03af24a048a0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEeAVx9wmIgWp3H2bOviugbcuxdgT\",\n \"object\": \"chat.completion\",\n \"created\": 1742830699,\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_Hk0WArcWvoNJjHYCJp78n6Gm\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{\\\"bold\\\":true}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1095,\n \"completion_tokens\": 40,\n \"total_tokens\": 1135,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1024,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_1f2b95d261b3a1e7c375df0da0889606.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_1f2b95d261b3a1e7c375df0da0889606.json
new file mode 100644
index 0000000000..d73f16b688
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_1f2b95d261b3a1e7c375df0da0889606.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEeAX9d5ERhuX6DDer1WAZeLqJsde\",\n \"object\": \"chat.completion\",\n \"created\": 1742830701,\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_dh2pF7asICJjG3UpMaRXufgX\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" world\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1050,\n \"completion_tokens\": 53,\n \"total_tokens\": 1103,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_b679845fcf0a2cd39422d37fa6ebed87.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_b679845fcf0a2cd39422d37fa6ebed87.json
new file mode 100644
index 0000000000..a9550b8db2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_b679845fcf0a2cd39422d37fa6ebed87.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSYuyyousrYRXdabOnAOXom7cgWa\",\n \"object\": \"chat.completion\",\n \"created\": 1743024412,\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_btWcHkauGDP7OqS5l74FYa2H\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" world\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 642,\n \"completion_tokens\": 53,\n \"total_tokens\": 695,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates paragraph with formatting_1_d7de08d5849e21ac18fafb6c024fda9f.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates paragraph with formatting_1_d7de08d5849e21ac18fafb6c024fda9f.json
new file mode 100644
index 0000000000..01b36ce055
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates paragraph with formatting_1_d7de08d5849e21ac18fafb6c024fda9f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"this is some bold\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and some \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" colored text\\\",\\\"styles\\\":{\\\"textColor\\\":\\\"red\\\"}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhX9xSPWwNgS46LP5Hafs97Q1K5I\",\n \"object\": \"chat.completion\",\n \"created\": 1743081963,\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_Os1DMQoaNNU92RtVBVpJ1Fmq\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hallo Welt, \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"das ist etwas Fettgedrucktes\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" und etwas \\\",\\\"styles\\\":{}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" farbiger Text\\\",\\\"styles\\\":{\\\"textColor\\\":\\\"red\\\"}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 688,\n \"completion_tokens\": 110,\n \"total_tokens\": 798,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_3576c63823dc560630adb2ad628a9644.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_3576c63823dc560630adb2ad628a9644.json
new file mode 100644
index 0000000000..e8a7487bac
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_3576c63823dc560630adb2ad628a9644.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BEeARdBQB5cdqFaIhbYQUUnKRNCG9\",\n \"object\": \"chat.completion\",\n \"created\": 1742830695,\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_qwbkUYNQfBCAXqjQI5zpB0iB\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hallo\\\",\\\"styles\\\":{}}]}},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Welt\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1095,\n \"completion_tokens\": 71,\n \"total_tokens\": 1166,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 1024,\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_eb9dce56a8\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_52269e16358f055dc0540870d78e1d47.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_52269e16358f055dc0540870d78e1d47.json
new file mode 100644
index 0000000000..fb896ffe43
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_52269e16358f055dc0540870d78e1d47.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFSYqRl86y5Js6dxNMy7BDW9RosYa\",\n \"object\": \"chat.completion\",\n \"created\": 1743024408,\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_S5GPszjDTJcWrEXNZ7WunVPA\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hallo\\\",\\\"styles\\\":{}}]}},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Welt\\\",\\\"styles\\\":{}}]}}]}\"\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\": 71,\n \"total_tokens\": 758,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_7cd169c0dd9559f09e810453ae29daed.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_7cd169c0dd9559f09e810453ae29daed.json
new file mode 100644
index 0000000000..8594793ce9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_7cd169c0dd9559f09e810453ae29daed.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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\":\"Add a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFLTvAwrx6Di8UJkmcT8K0LUPV5C8\",\n \"object\": \"chat.completion\",\n \"created\": 1742997195,\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_Cd46uNx7My4tFZTkSkC2Xw2X\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hallo\\\",\\\"styles\\\":{}}]}},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"1$\\\",\\\"block\\\":{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Welt\\\",\\\"styles\\\":{}}]}}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1086,\n \"completion_tokens\": 107,\n \"total_tokens\": 1193,\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_4ecdfc8cdc\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_53a81a263f6fb1eccb980cc1be96a004.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_53a81a263f6fb1eccb980cc1be96a004.json
new file mode 100644
index 0000000000..44f0a77b9e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_53a81a263f6fb1eccb980cc1be96a004.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_n5qdODRO38FCsHpi3uo0JfMb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"heading\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"],\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"level\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6w03E4ZASHRYGtSwIwTTYSxiSi\",\"object\":\"chat.completion.chunk\",\"created\":1742830478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_f96deafa34b0601f5935ac17ba659ef0.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_f96deafa34b0601f5935ac17ba659ef0.json
new file mode 100644
index 0000000000..2c1a1b391d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_f96deafa34b0601f5935ac17ba659ef0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_WDi8UERXuMozb1gVDc7fcYiH\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"heading\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"],\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"props\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"level\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYR8T4YjY4KYw0QTj6xBPmZCavT\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_162aafac3c9a5cfc8b48bdd6ac5cd9a6.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_162aafac3c9a5cfc8b48bdd6ac5cd9a6.json
new file mode 100644
index 0000000000..2179d8eb2e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_162aafac3c9a5cfc8b48bdd6ac5cd9a6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_LpzFi6hnkRofHpXIpTzYpRmD\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYRm6OIiN70fmoLgrvcBZhWgUYI\",\"object\":\"chat.completion.chunk\",\"created\":1743024383,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_d77c2fd0f1d16dcb0e5bdc2294067961.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_d77c2fd0f1d16dcb0e5bdc2294067961.json
new file mode 100644
index 0000000000..5bb5023e3a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_d77c2fd0f1d16dcb0e5bdc2294067961.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_iQOCLhDvo66dzLUZ7OukprT6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6yziEyajWkhGq6jW0146YcU5Lp\",\"object\":\"chat.completion.chunk\",\"created\":1742830480,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_853592a67e232ecb6cc02018d6f980e0.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_853592a67e232ecb6cc02018d6f980e0.json
new file mode 100644
index 0000000000..ecc14fa09c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_853592a67e232ecb6cc02018d6f980e0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Tdg9SUjViZRXPDY3iA5LLsvE\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}},\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe71a7vu1cJctX3iPqnHgKo1xgit\",\"object\":\"chat.completion.chunk\",\"created\":1742830483,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_6ec83003ad\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_dcf4b9b0862859cf085ec6929cb56f60.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_dcf4b9b0862859cf085ec6929cb56f60.json
new file mode 100644
index 0000000000..f13defe91b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_dcf4b9b0862859cf085ec6929cb56f60.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello world\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_OHevXXfEAf2ve7Hl5ij82pBn\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"true\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}},\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYTOI3745p91HpCoMqBcpD6mjna\",\"object\":\"chat.completion.chunk\",\"created\":1743024385,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_1b00194e073df29c3374b58ff88b2b3d.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_1b00194e073df29c3374b58ff88b2b3d.json
new file mode 100644
index 0000000000..1aca5fe5e4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_1b00194e073df29c3374b58ff88b2b3d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Qm4Y0nu5j36tFt3BTY8y1ijC\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"W\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"elt\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BEe6uXmQsvHg3RLLMU9D50E4iCZf3\",\"object\":\"chat.completion.chunk\",\"created\":1742830476,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_eb9dce56a8\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_59d6b330c015ffe543b43b0e1e37c4c7.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_59d6b330c015ffe543b43b0e1e37c4c7.json
new file mode 100644
index 0000000000..4273b918bf
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_59d6b330c015ffe543b43b0e1e37c4c7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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\":\"Add a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_QtXSS7T4ggPR2WYLNgtWTCqM\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"W\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"elt\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFLTo2Hxh6qZDczVVTY2cTtPZV78C\",\"object\":\"chat.completion.chunk\",\"created\":1742997188,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_4ecdfc8cdc\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_80fe59b49997e278ea0f7891d9ad42f2.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_80fe59b49997e278ea0f7891d9ad42f2.json
new file mode 100644
index 0000000000..5075ded543
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_80fe59b49997e278ea0f7891d9ad42f2.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"quote\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_U24bxKanOzLJByuuMtr2vkdI\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"paragraph\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"W\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"elt\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"styles\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFSYPhNCmsZp6LBKhRbcGeUmbYKX6\",\"object\":\"chat.completion.chunk\",\"created\":1743024381,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_cbff9f62f99aecfc4d685e098a0768fc.json b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_cbff9f62f99aecfc4d685e098a0768fc.json
new file mode 100644
index 0000000000..52390705fe
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/__snapshots__/json.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_cbff9f62f99aecfc4d685e098a0768fc.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Hello\\\",\\\"styles\\\":{}}],\\\"children\\\":[]},{\\\"id\\\":\\\"1$\\\",\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{\\\"textColor\\\":\\\"default\\\",\\\"backgroundColor\\\":\\\"default\\\",\\\"textAlignment\\\":\\\"left\\\"},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"World\\\",\\\"styles\\\":{}}],\\\"children\\\":[]}]\"},{\"role\":\"system\",\"content\":\"This would be an example block: \\n{\\\"type\\\":\\\"paragraph\\\",\\\"props\\\":{},\\\"content\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Bold text\\\",\\\"styles\\\":{\\\"bold\\\":true}},{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\" and italic text\\\",\\\"styles\\\":{\\\"italic\\\":true}}]}\"},{\"role\":\"user\",\"content\":\"translate existing document 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\":\"Add a block\",\"properties\":{\"type\":\"object\",\"properties\":{\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"referenceId\",\"position\",\"blocks\"]},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"id\",\"block\"]},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"id\"]},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"styles\":{\"type\":\"object\",\"properties\":{\"bold\":{\"type\":\"boolean\"},\"italic\":{\"type\":\"boolean\"},\"underline\":{\"type\":\"boolean\"},\"strike\":{\"type\":\"boolean\"},\"code\":{\"type\":\"boolean\"},\"textColor\":{\"type\":\"string\"},\"backgroundColor\":{\"type\":\"string\"}},\"additionalProperties\":false},\"styledtext\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"text\"]},\"text\":{\"type\":\"string\"},\"styles\":{\"$ref\":\"#/$defs/styles\"}},\"additionalProperties\":false,\"required\":[\"type\",\"text\"]},\"inlinecontent\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/styledtext\"},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"link\"]},\"content\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/styledtext\"}},\"href\":{\"type\":\"string\"}},\"additionalProperties\":false,\"required\":[\"type\",\"href\",\"content\"]}]}},\"block\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"paragraph\",\"bulletListItem\",\"numberedListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"heading\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"level\":{\"type\":\"number\",\"enum\":[1,2,3]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"codeBlock\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"language\":{\"type\":\"string\",\"enum\":[\"text\",\"c\",\"cpp\",\"css\",\"glsl\",\"graphql\",\"haml\",\"html\",\"java\",\"javascript\",\"json\",\"jsonc\",\"jsonl\",\"jsx\",\"julia\",\"less\",\"markdown\",\"mdx\",\"php\",\"postcss\",\"pug\",\"python\",\"r\",\"regexp\",\"sass\",\"scss\",\"shellscript\",\"sql\",\"svelte\",\"typescript\",\"vue\",\"vue-html\",\"wasm\",\"wgsl\",\"xml\",\"yaml\",\"tsx\",\"haskell\",\"csharp\",\"latex\",\"lua\",\"mermaid\",\"ruby\",\"rust\",\"scala\",\"swift\",\"kotlin\",\"objective-c\"]}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"checkListItem\"]},\"content\":{\"$ref\":\"#/$defs/inlinecontent\"},\"props\":{\"type\":\"object\",\"properties\":{\"checked\":{\"type\":\"boolean\"}},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]},{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"table\"]},\"content\":{\"type\":\"object\",\"properties\":{}},\"props\":{\"type\":\"object\",\"properties\":{},\"additionalProperties\":false}},\"additionalProperties\":false,\"required\":[\"type\"]}]}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\n \"error\": {\n \"message\": \"Invalid schema for function 'json': ['referenceId', 'position', 'blocks'] is not of type 'object', 'boolean'.\",\n \"type\": \"invalid_request_error\",\n \"param\": \"tools[0].function.parameters\",\n \"code\": \"invalid_function_parameters\"\n }\n}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/checks.test.ts b/packages/xl-ai/src/api/formats/json/checks.test.ts
new file mode 100644
index 0000000000..b63ca0036a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/checks.test.ts
@@ -0,0 +1,114 @@
+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 { callLLM } 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", {});
+
+describe("Test environment", () => {
+ // doesn't appear to be needed
+ // it("should be running correct node version", () => {
+ // expect(process.version).toBe("v20.11.0");
+ // });
+
+ it("should have certs installed to connect to localhost", () => {
+ expect(process.env.NODE_EXTRA_CA_CERTS).toBeDefined();
+
+ /* if this test fails, maybe you're running tests via vscode extension?
+
+ You'll need:
+
+ "vitest.nodeEnv": {
+ "NODE_EXTRA_CA_CERTS": "/Users/USERNAME/Library/Application Support/mkcert/rootCA.pem"
+ }
+
+ in your vscode settings (or other path to mkcert rootCA.pem)
+ */
+ });
+});
+
+// Separate test suite for error handling with its own server
+describe("Error handling", () => {
+ // Create a separate server for error tests with custom handlers
+ const errorServer = setupServer();
+
+ beforeAll(() => {
+ errorServer.listen();
+ });
+
+ afterAll(() => {
+ errorServer.close();
+ });
+
+ afterEach(() => {
+ 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",
+ },
+ }),
+ {
+ status: 429,
+ headers: {
+ "Content-Type": "application/json",
+ },
+ }
+ );
+ })
+ );
+
+ 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;
+
+ try {
+ const result = await callLLM(editor, {
+ stream: true,
+ userPrompt: "translate to Spanish",
+ model: openai,
+ maxRetries: 0,
+ });
+ await result.apply();
+ } 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"
+ );
+ });
+});
diff --git a/packages/xl-ai/src/api/formats/json/json.test.ts b/packages/xl-ai/src/api/formats/json/json.test.ts
new file mode 100644
index 0000000000..c542d7b7ef
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/json.test.ts
@@ -0,0 +1,124 @@
+import { afterAll, afterEach, beforeAll, describe } from "vitest";
+
+import { getCurrentTest } from "@vitest/runner";
+import { getSortedEntries, snapshot, toHashString } from "msw-snapshot";
+import { setupServer } from "msw/node";
+import path from "path";
+import { generateSharedTestCases } from "../tests/sharedTestCases.js";
+
+import { testAIModels } from "../../../testUtil/testAIModels.js";
+import { callLLM } from "./json.js";
+
+const BASE_FILE_PATH = path.resolve(
+ __dirname,
+ "__snapshots__",
+ path.basename(__filename),
+);
+
+const fetchCountMap: Record = {};
+
+async function createRequestHash(req: Request) {
+ const url = new URL(req.url);
+ return [
+ // url.host,
+ // url.pathname,
+ toHashString([
+ req.method,
+ url.origin,
+ url.pathname,
+ getSortedEntries(url.searchParams),
+ getSortedEntries(req.headers),
+ // getSortedEntries(req.cookies),
+ new TextDecoder("utf-8").decode(await req.arrayBuffer()),
+ ]),
+ ].join("/");
+}
+
+// Main test suite with snapshot middleware
+describe("Models", () => {
+ // Define server with snapshot middleware for the main tests
+ const server = setupServer(
+ snapshot({
+ updateSnapshots: "missing",
+ // updateSnapshots: "all",
+ // ignoreSnapshots: true,
+ async createSnapshotPath(info) {
+ // use a unique path for each model
+ const t = getCurrentTest()!;
+ const mswPath = path.join(
+ t.suite!.name, // same directory as the test snapshot
+ "__msw_snapshots__",
+ t.suite!.suite!.name, // model / streaming params
+ t.name,
+ );
+ // in case there are multiple requests in a test, we need to use a separate snapshot for each request
+ fetchCountMap[mswPath] = (fetchCountMap[mswPath] || 0) + 1;
+ const hash = await createRequestHash(info.request);
+ return mswPath + `_${fetchCountMap[mswPath]}_${hash}.json`;
+ },
+ basePath: BASE_FILE_PATH,
+ // onFetchFromSnapshot(info, snapshot) {
+ // console.log("onFetchFromSnapshot", info, snapshot);
+ // },
+ // onFetchFromServer(info, snapshot) {
+ // console.log("onFetchFromServer", info, snapshot);
+ // },
+ }),
+ );
+
+ beforeAll(() => {
+ server.listen();
+ });
+
+ afterAll(() => {
+ server.close();
+ });
+
+ afterEach(() => {
+ delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
+ });
+
+ const testMatrix = [
+ {
+ model: testAIModels.openai,
+ stream: true,
+ },
+ {
+ model: testAIModels.openai,
+ stream: false,
+ },
+ {
+ model: testAIModels.groq,
+ stream: true,
+ },
+ {
+ model: testAIModels.groq,
+ stream: false,
+ },
+ // this model doesn't work well with json format
+ // {
+ // model: albert,
+ // stream: true,
+ // },
+ // {
+ // model: albert,
+ // stream: false,
+ // },
+ ];
+
+ for (const params of testMatrix) {
+ describe(`${params.model.provider}/${params.model.modelId} (${
+ params.stream ? "streaming" : "non-streaming"
+ })`, () => {
+ generateSharedTestCases((editor, options) =>
+ callLLM(editor, {
+ ...options,
+ stream: params.stream,
+ model: params.model,
+ maxRetries: 0,
+ withDelays: false,
+ }),
+ );
+ });
+ }
+});
diff --git a/packages/xl-ai/src/api/formats/json/json.ts b/packages/xl-ai/src/api/formats/json/json.ts
new file mode 100644
index 0000000000..01ddd02975
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/json.ts
@@ -0,0 +1,198 @@
+import { Block, BlockNoteEditor } from "@blocknote/core";
+import { generateObject, streamObject } from "ai";
+import type { PromptOrMessages } from "../../index.js";
+import {
+ generateOperations,
+ LLMRequestOptions,
+ streamOperations,
+} from "../../streamTool/callLLMWithStreamTools.js";
+import { StreamTool } from "../../streamTool/streamTool.js";
+import { isEmptyParagraph } from "../../util/emptyBlock.js";
+import {
+ getDataForPromptNoSelection,
+ getDataForPromptWithSelection,
+} from "./jsonPromptData.js";
+
+import {
+ promptManipulateDocumentUseJSONBlocks,
+ promptManipulateSelectionJSONBlocks,
+} from "../../prompts/jsonSchemaPrompts.js";
+import { CallLLMResult } from "../CallLLMResult.js";
+import { tools } from "./tools/index.js";
+
+// TODO: merge this file with htmlBlocks.ts
+
+async function getMessages(
+ editor: BlockNoteEditor,
+ opts: {
+ selectedBlocks?: Block[];
+ excludeBlockIds?: string[];
+ } & PromptOrMessages,
+) {
+ // TODO: child blocks
+ // TODO: document how to customize prompt
+ if ("messages" in opts && opts.messages) {
+ return opts.messages;
+ } else if (opts.selectedBlocks) {
+ if (opts.excludeBlockIds) {
+ throw new Error(
+ "expected excludeBlockIds to be false when selectedBlocks is provided",
+ );
+ }
+ return promptManipulateSelectionJSONBlocks({
+ ...(await getDataForPromptWithSelection(editor, opts.selectedBlocks)),
+ userPrompt: opts.userPrompt,
+ });
+ } else {
+ if (opts.useSelection) {
+ throw new Error(
+ "expected useSelection to be false when selectedBlocks is not provided",
+ );
+ }
+ return promptManipulateDocumentUseJSONBlocks({
+ ...(await getDataForPromptNoSelection(editor, {
+ excludeBlockIds: opts.excludeBlockIds,
+ })),
+ userPrompt: opts.userPrompt,
+ });
+ }
+}
+
+function getStreamTools(
+ 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,
+ };
+
+ const streamTools: StreamTool[] = [
+ ...(mergedStreamTools.update
+ ? [
+ tools.update(editor, {
+ idsSuffixed: true,
+ withDelays,
+ updateSelection: selectionInfo,
+ }),
+ ]
+ : []),
+ ...(mergedStreamTools.add
+ ? [tools.add(editor, { idsSuffixed: true, withDelays })]
+ : []),
+ ...(mergedStreamTools.delete
+ ? [tools.delete(editor, { idsSuffixed: true, withDelays })]
+ : []),
+ ];
+
+ return streamTools;
+}
+
+export async function callLLM(
+ editor: BlockNoteEditor,
+ opts: Omit &
+ PromptOrMessages & {
+ 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;
+ };
+ stream?: boolean;
+ deleteEmptyCursorBlock?: boolean;
+ onStart?: () => void;
+ withDelays?: boolean;
+ _generateObjectOptions?: Partial<
+ Parameters>[0]
+ >;
+ _streamObjectOptions?: Partial>[0]>;
+ },
+): Promise {
+ const {
+ userPrompt: prompt,
+ useSelection,
+ deleteEmptyCursorBlock,
+ stream,
+ onStart,
+ withDelays,
+ ...rest
+ } = {
+ deleteEmptyCursorBlock: true,
+ stream: true,
+ withDelays: true,
+ ...opts,
+ };
+
+ const cursorBlock = useSelection
+ ? undefined
+ : editor.getTextCursorPosition().block;
+
+ const deleteCursorBlock: string | undefined =
+ cursorBlock && deleteEmptyCursorBlock && isEmptyParagraph(cursorBlock)
+ ? cursorBlock.id
+ : undefined;
+
+ const selectionInfo = useSelection ? editor.getSelection2() : undefined;
+
+ const messages = await getMessages(editor, {
+ ...opts,
+ selectedBlocks: selectionInfo?.blocks,
+ excludeBlockIds: deleteCursorBlock ? [deleteCursorBlock] : undefined,
+ });
+
+ const streamTools = getStreamTools(
+ editor,
+ withDelays,
+ opts.defaultStreamTools,
+ selectionInfo
+ ? { from: selectionInfo._meta.startPos, to: selectionInfo._meta.endPos }
+ : undefined,
+ );
+
+ let response:
+ | Awaited>>
+ | Awaited>>;
+
+ if (stream || stream === undefined) {
+ response = await streamOperations(
+ streamTools,
+ {
+ messages,
+ ...rest,
+ },
+ () => {
+ if (deleteCursorBlock) {
+ editor.removeBlocks([deleteCursorBlock]);
+ }
+ onStart?.();
+ },
+ );
+ } else {
+ response = await generateOperations(streamTools, {
+ messages,
+ ...rest,
+ });
+ if (deleteCursorBlock) {
+ editor.removeBlocks([deleteCursorBlock]);
+ }
+ onStart?.();
+ }
+
+ return new CallLLMResult(response, streamTools);
+}
diff --git a/packages/xl-ai/src/api/formats/json/jsonPromptData.ts b/packages/xl-ai/src/api/formats/json/jsonPromptData.ts
new file mode 100644
index 0000000000..da20e2bcd3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/jsonPromptData.ts
@@ -0,0 +1,40 @@
+import {
+ Block,
+ BlockNoteEditor
+} from "@blocknote/core";
+import { addCursorPosition } from "../../prompts/promptHelpers/addCursorPosition.js";
+import { convertBlocks } from "../../prompts/promptHelpers/convertBlocks.js";
+import { suffixIDs } from "../../prompts/promptHelpers/suffixIds.js";
+import { trimEmptyBlocks } from "../../prompts/promptHelpers/trimEmptyBlocks.js";
+
+// TODO
+ export async function getDataForPromptNoSelection(editor: BlockNoteEditor, opts: {
+ excludeBlockIds?: string[]
+ }) {
+ const input = trimEmptyBlocks(editor.document);
+ const blockArray = await convertBlocks(input, async (block) => {
+ return block
+ });
+ const withCursor = addCursorPosition(editor, blockArray);
+
+ const filtered = withCursor.filter(b => "cursor" in b || !(opts.excludeBlockIds || []).includes(b.id));
+ const suffixed = suffixIDs(filtered);
+ return {
+ jsonBlocks: suffixed,
+ };
+ }
+
+ // TODO
+ export async function getDataForPromptWithSelection(editor: BlockNoteEditor, selectedBlocks: Block[]) {
+ const blockArray = await convertBlocks(selectedBlocks, async (block) => {
+ return block
+ });
+ const suffixed = suffixIDs(blockArray);
+
+ return {
+ jsonSelectedBlocks: suffixed,
+ jsonDocument: (await convertBlocks(editor.document, async (block) => {
+ return block
+ })).map(({ block }) => ({block})), // strip ids so LLM can't accidentally issue updates to ids not in selection (TODO: implement for json)
+ };
+ }
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/json/tools/index.ts b/packages/xl-ai/src/api/formats/json/tools/index.ts
new file mode 100644
index 0000000000..a2b8ebac51
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/tools/index.ts
@@ -0,0 +1,45 @@
+import { PartialBlock } from "@blocknote/core";
+
+import {
+ getApplySuggestionsTr,
+ rebaseTool,
+} from "../../../../prosemirror/rebaseTool.js";
+import { createAddBlocksTool } from "../../../tools/createAddBlocksTool.js";
+import { createUpdateBlockTool } from "../../../tools/createUpdateBlockTool.js";
+import { deleteBlockTool } from "../../../tools/delete.js";
+import { validateBlockFunction } from "./validate.js";
+
+export const tools = {
+ add: createAddBlocksTool>({
+ description: "Insert new blocks",
+ schema: {
+ block: {
+ $ref: "#/$defs/block",
+ },
+ },
+ validateBlock: validateBlockFunction,
+ rebaseTool: async (_id, editor) =>
+ rebaseTool(editor, getApplySuggestionsTr(editor)),
+ toJSONToolCall: async (_editor, chunk) => {
+ return chunk.operation;
+ },
+ }),
+ update: createUpdateBlockTool>({
+ description:
+ "Update a block, the new block will replace the existing block.",
+ schema: {
+ block: {
+ $ref: "#/$defs/block",
+ },
+ },
+ validateBlock: validateBlockFunction,
+ rebaseTool: async (_id, editor) =>
+ rebaseTool(editor, getApplySuggestionsTr(editor)),
+ toJSONToolCall: async (_editor, chunk) => {
+ return chunk.operation;
+ },
+ }),
+ delete: deleteBlockTool,
+};
+
+export type Tools = ReturnType<(typeof tools)[keyof typeof tools]>;
diff --git a/packages/xl-ai/src/api/formats/json/tools/validate.ts b/packages/xl-ai/src/api/formats/json/tools/validate.ts
new file mode 100644
index 0000000000..f84ea6a86a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/json/tools/validate.ts
@@ -0,0 +1,107 @@
+import {
+ BlockNoteEditor,
+ PartialBlock,
+ isLinkInlineContent,
+ isStyledTextInlineContent,
+} from "@blocknote/core";
+import { InvalidOrOk } from "../../../streamTool/streamTool";
+
+function validateInlineContent(content: any, editor: any): boolean {
+ const inlineContentConfig =
+ editor.schema.inlineContentSchema[
+ content.type as keyof typeof editor.schema.inlineContentSchema
+ ];
+
+ if (!inlineContentConfig) {
+ return false;
+ }
+
+ if (isStyledTextInlineContent(content)) {
+ if (!("text" in content)) {
+ return false;
+ }
+ }
+
+ if (isLinkInlineContent(content)) {
+ if (!("content" in content) || !("href" in content)) {
+ return false;
+ }
+
+ return validateInlineContent(content.content, editor);
+ }
+
+ // TODO: custom ic content
+ return true;
+}
+
+export function validateBlockFunction(
+ block: any,
+ editor: BlockNoteEditor,
+ fallbackType?: string
+): InvalidOrOk> {
+ const type = block.type || fallbackType;
+ const blockConfig =
+ editor.schema.blockSchema[type as keyof typeof editor.schema.blockSchema];
+
+ if (!blockConfig) {
+ return {
+ result: "invalid",
+ reason: "block type not found in editor",
+ };
+ }
+
+ if (block.children) {
+ // LLM tools are not supposed to edit children at this moment
+ // return false; TODO, bringing this back breaks markdown tests
+ }
+
+ if (blockConfig.content === "none") {
+ if (block.content) {
+ // no content expected for this block
+ return {
+ result: "invalid",
+ reason: "block content not expected for this block type",
+ };
+ }
+ } else {
+ if (!block.content) {
+ // return false;
+ return {
+ result: "ok",
+ value: block,
+ };
+ }
+
+ if (!Array.isArray(block.content)) {
+ // content expected for this block
+ return {
+ result: "invalid",
+ reason: "block content must be an array",
+ };
+ }
+
+ if (blockConfig.content === "table") {
+ // no validation for table content (TODO)
+ return {
+ result: "ok",
+ value: block,
+ };
+ }
+
+ if (
+ !(block.content as []).every((content: any) => {
+ return validateInlineContent(content, editor);
+ })
+ ) {
+ return {
+ result: "invalid",
+ reason: "block content must be an array of inline content",
+ };
+ }
+ }
+ // TODO: validate props
+ return {
+ result: "ok",
+ value: block,
+ };
+}
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_274f7e0cbbea81fd5e1e4ad739e4185b.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_274f7e0cbbea81fd5e1e4ad739e4185b.json
new file mode 100644
index 0000000000..a26ad2d90e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/deletes a paragraph_1_274f7e0cbbea81fd5e1e4ad739e4185b.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_2c0ef19cec3558362f101b2312979377.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_2c0ef19cec3558362f101b2312979377.json
new file mode 100644
index 0000000000..3ff294e5b3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/deletes a paragraph_1_2c0ef19cec3558362f101b2312979377.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-55f89903-f9d8-4d4f-b16a-07536f881272\",\"object\":\"chat.completion\",\"created\":1743013799,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_av53\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.129683695,\"prompt_tokens\":516,\"prompt_time\":0.034752722,\"completion_tokens\":20,\"completion_time\":0.077857755,\"total_tokens\":536,\"total_time\":0.112610477},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq9vfsj9ftc9e2as9dptan3f\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_0c45b1844cfa745ad5b95536e0a025ab.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_0c45b1844cfa745ad5b95536e0a025ab.json
new file mode 100644
index 0000000000..af686c11fb
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/deletes a paragraph_1_0c45b1844cfa745ad5b95536e0a025ab.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-ae93d2b0-35aa-40c9-9821-0443cb411929\",\"object\":\"chat.completion.chunk\",\"created\":1743013790,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfh3jeqbvv6rn4ev7eweg\"}}\n\ndata: {\"id\":\"chatcmpl-ae93d2b0-35aa-40c9-9821-0443cb411929\",\"object\":\"chat.completion.chunk\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_5k7m\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"delete\\\", \\\"id\\\": \\\"0$\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ae93d2b0-35aa-40c9-9821-0443cb411929\",\"object\":\"chat.completion.chunk\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfh3jeqbvv6rn4ev7eweg\",\"usage\":{\"queue_time\":0.129643218,\"prompt_tokens\":516,\"prompt_time\":0.033677927,\"completion_tokens\":20,\"completion_time\":0.078069632,\"total_tokens\":536,\"total_time\":0.111747559}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_2c30b8d1a406dc18ac6ecd886e001ddd.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_2c30b8d1a406dc18ac6ecd886e001ddd.json
new file mode 100644
index 0000000000..6e7a1f01ab
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/deletes a paragraph_1_2c30b8d1a406dc18ac6ecd886e001ddd.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnPjuXollT5HWU4NDDrrDOALhSE\",\n \"object\": \"chat.completion\",\n \"created\": 1743013779,\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_KWjJoTw3JsogL6IhTHeA0EcO\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"delete\\\",\\\"id\\\":\\\"0$\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 223,\n \"completion_tokens\": 15,\n \"total_tokens\": 238,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_ab632d7ac61a9abd808d8c322f0d1baf.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_ab632d7ac61a9abd808d8c322f0d1baf.json
new file mode 100644
index 0000000000..ae751a8875
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Delete/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/deletes a paragraph_1_ab632d7ac61a9abd808d8c322f0d1baf.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_5FsJ5L2Curds2K9RLTw7YwiS\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"delete\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn6DB0Bu27gVPKWmO6fs0pJ3641\",\"object\":\"chat.completion.chunk\",\"created\":1743013760,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/inserts a paragraph at end_1_ff74e275f88eff2be9e61bc1be7f3ba1.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/inserts a paragraph at end_1_ff74e275f88eff2be9e61bc1be7f3ba1.json
new file mode 100644
index 0000000000..79778706c2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/inserts a paragraph at end_1_ff74e275f88eff2be9e61bc1be7f3ba1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/inserts a paragraph at start_1_dcff81f9f7f151e3175cf8500f1c24c4.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/inserts a paragraph at start_1_dcff81f9f7f151e3175cf8500f1c24c4.json
new file mode 100644
index 0000000000..aa56cd39d0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/inserts a paragraph at start_1_dcff81f9f7f151e3175cf8500f1c24c4.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_f9a490fe857779deaf00259e354edca6.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_f9a490fe857779deaf00259e354edca6.json
new file mode 100644
index 0000000000..e2e66d1ce8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at end_1_f9a490fe857779deaf00259e354edca6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-f9df9eea-798d-4bd4-8769-1ea1026c6839\",\"object\":\"chat.completion\",\"created\":1743013800,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_p9tb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"position\\\": \\\"after\\\", \\\"blocks\\\": [\\\"Test\\\"]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10138115,\"prompt_tokens\":515,\"prompt_time\":0.033181087,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":548,\"total_time\":0.153181087},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq9vftfmffgrw287thhcpfqp\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_0cd1e1ad0b731e3a0b2f4c7a1c103f30.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_0cd1e1ad0b731e3a0b2f4c7a1c103f30.json
new file mode 100644
index 0000000000..378afdbc2c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_0cd1e1ad0b731e3a0b2f4c7a1c103f30.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-93b710b2-0084-4d30-9506-40d7e278b276\",\"object\":\"chat.completion\",\"created\":1743014265,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_vab9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"position\\\": \\\"before\\\", \\\"blocks\\\": [\\\"Test\\\"]}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10115247,\"prompt_tokens\":518,\"prompt_time\":0.036404566,\"completion_tokens\":33,\"completion_time\":0.489918657,\"total_tokens\":551,\"total_time\":0.526323223},\"system_fingerprint\":\"fp_8dd9fca28c\",\"x_groq\":{\"id\":\"req_01jq9vy0n0e8fr0wbdmsj7mz92\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_801c5a3b5176f1b56225e32705f2613c.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_801c5a3b5176f1b56225e32705f2613c.json
new file mode 100644
index 0000000000..a67de95199
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/inserts a paragraph at start_1_801c5a3b5176f1b56225e32705f2613c.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"error\":{\"message\":\"Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.\",\"type\":\"invalid_request_error\",\"code\":\"tool_use_failed\",\"failed_generation\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"Test\\\"]}]}\\u003e\\u003c/function\\u003e\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_af8e9c69be096cd9417815ddd60533a4.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_af8e9c69be096cd9417815ddd60533a4.json
new file mode 100644
index 0000000000..56dbbfcaf6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at end_1_af8e9c69be096cd9417815ddd60533a4.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d04f3912-8feb-4306-bfd9-a629b1f85ade\",\"object\":\"chat.completion.chunk\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfht0ffcbxdjhws3cs6s1\"}}\n\ndata: {\"id\":\"chatcmpl-d04f3912-8feb-4306-bfd9-a629b1f85ade\",\"object\":\"chat.completion.chunk\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_j9dt\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"position\\\": \\\"after\\\", \\\"blocks\\\": [\\\"Test\\\"]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d04f3912-8feb-4306-bfd9-a629b1f85ade\",\"object\":\"chat.completion.chunk\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_34555b7c20\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfht0ffcbxdjhws3cs6s1\",\"usage\":{\"queue_time\":0.101485617,\"prompt_tokens\":515,\"prompt_time\":0.033148176,\"completion_tokens\":33,\"completion_time\":0.12,\"total_tokens\":548,\"total_time\":0.153148176}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_114a38fa039ca5df95f68eb12f935242.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_114a38fa039ca5df95f68eb12f935242.json
new file mode 100644
index 0000000000..8a4f9b45e3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/inserts a paragraph at start_1_114a38fa039ca5df95f68eb12f935242.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-3965bf4f-f267-4301-8e49-b37081be5719\",\"object\":\"chat.completion.chunk\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfhcgeqbsxcv5ycq79ava\"}}\n\ndata: {\"id\":\"chatcmpl-3965bf4f-f267-4301-8e49-b37081be5719\",\"object\":\"chat.completion.chunk\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_qcp3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"add\\\", \\\"referenceId\\\": \\\"0$\\\", \\\"position\\\": \\\"before\\\", \\\"blocks\\\": [\\\"Test\\\"]}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-3965bf4f-f267-4301-8e49-b37081be5719\",\"object\":\"chat.completion.chunk\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfhcgeqbsxcv5ycq79ava\",\"usage\":{\"queue_time\":0.128472071,\"prompt_tokens\":514,\"prompt_time\":0.035756267,\"completion_tokens\":33,\"completion_time\":0.121262685,\"total_tokens\":547,\"total_time\":0.157018952}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_e975b8b90b0921996854c2baeccf1ca9.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_e975b8b90b0921996854c2baeccf1ca9.json
new file mode 100644
index 0000000000..4b76c348e8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at end_1_e975b8b90b0921996854c2baeccf1ca9.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnRGsQdrDEF5BhIQ8yU5U8GOpbe\",\n \"object\": \"chat.completion\",\n \"created\": 1743013781,\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_UZvKaw1IYuHrbnBeVtp07NDS\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"Test\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 222,\n \"completion_tokens\": 25,\n \"total_tokens\": 247,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_60a5c88eaed240e665ad245a626523bf.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_60a5c88eaed240e665ad245a626523bf.json
new file mode 100644
index 0000000000..44df0fc720
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/inserts a paragraph at start_1_60a5c88eaed240e665ad245a626523bf.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnQtnhJJTKH0f0Rg85u5fJ204vd\",\n \"object\": \"chat.completion\",\n \"created\": 1743013780,\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_YFg4zlbL2vs0ReDkejjH36BV\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"0$\\\",\\\"position\\\":\\\"before\\\",\\\"blocks\\\":[\\\"Test\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 221,\n \"completion_tokens\": 25,\n \"total_tokens\": 246,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_fa54cb6e1cdd49fe77be2676ea1c25c0.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_fa54cb6e1cdd49fe77be2676ea1c25c0.json
new file mode 100644
index 0000000000..ccdd9db8ac
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at end_1_fa54cb6e1cdd49fe77be2676ea1c25c0.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a paragraph with text \\\"Test\\\" after the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_guUAx36QnBAsKaQV1zS01Q5q\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"after\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn90qnsLBcEi6FktbrO46abSfE6\",\"object\":\"chat.completion.chunk\",\"created\":1743013763,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_e5b19fcecfafe5f0a3e08b3dbe45c037.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_e5b19fcecfafe5f0a3e08b3dbe45c037.json
new file mode 100644
index 0000000000..089f618bbf
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Insert/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/inserts a paragraph at start_1_e5b19fcecfafe5f0a3e08b3dbe45c037.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"}]\"},{\"role\":\"user\",\"content\":\"Add a sentence with `Test` before the first sentence\"}],\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_IVAvLgCy9NPYcSr8eFztxqbF\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"add\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"reference\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"position\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"before\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blocks\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Test\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"]\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn8fJz3La3ENcFOqZxhJJdwVCh7\",\"object\":\"chat.completion.chunk\",\"created\":1743013762,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link and change text within mark_1_7fa9f08719311fa03ae061d192fefe1b.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link and change text within mark_1_7fa9f08719311fa03ae061d192fefe1b.json
new file mode 100644
index 0000000000..b8a5ed60cd
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link and change text within mark_1_7fa9f08719311fa03ae061d192fefe1b.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link_1_dd2a239803073b3e28f5d78839f48a76.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link_1_dd2a239803073b3e28f5d78839f48a76.json
new file mode 100644
index 0000000000..0bd53096b1
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/drop mark and link_1_dd2a239803073b3e28f5d78839f48a76.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_82a76448c70c10180bf9d0590fdb1251.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_82a76448c70c10180bf9d0590fdb1251.json
new file mode 100644
index 0000000000..b68c9362f3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_82a76448c70c10180bf9d0590fdb1251.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_8d0176d2f65914b14cbb58a8608bb27c.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_8d0176d2f65914b14cbb58a8608bb27c.json
new file mode 100644
index 0000000000..c695f3672f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_8d0176d2f65914b14cbb58a8608bb27c.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_f8bc61c9e2a9dd9c4bdaacabf73afca8.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_f8bc61c9e2a9dd9c4bdaacabf73afca8.json
new file mode 100644
index 0000000000..8be2b5f31b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/standard update_1_f8bc61c9e2a9dd9c4bdaacabf73afca8.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"guided_decoding_backend\":\"outlines\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"Request-level structured output backend must match engine-level backend. outlines != xgrammar\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mark_1_b3ea22630b8ab20801e2f402a6e23712.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mark_1_b3ea22630b8ab20801e2f402a6e23712.json
new file mode 100644
index 0000000000..8205c5b5db
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mark_1_b3ea22630b8ab20801e2f402a6e23712.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mention_1_a01cacea6b5ca16669f10002ef98d7bd.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mention_1_a01cacea6b5ca16669f10002ef98d7bd.json
new file mode 100644
index 0000000000..d2a8b9e477
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block, remove mention_1_a01cacea6b5ca16669f10002ef98d7bd.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block_1_792ba524b3cfecfae5145b4f85bb4056.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block_1_792ba524b3cfecfae5145b4f85bb4056.json
new file mode 100644
index 0000000000..01c5891563
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in source block_1_792ba524b3cfecfae5145b4f85bb4056.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark_1_e2b4321a2b418e681965f676976246a6.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark_1_e2b4321a2b418e681965f676976246a6.json
new file mode 100644
index 0000000000..c8cbd27a82
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/styles + ic in target block, add mark_1_e2b4321a2b418e681965f676976246a6.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type and content_1_05d8cc6fde21135f057d135e43f5f304.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type and content_1_05d8cc6fde21135f057d135e43f5f304.json
new file mode 100644
index 0000000000..e19dc2eafa
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type and content_1_05d8cc6fde21135f057d135e43f5f304.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_49f31c1438b6931034b026c48da0e53f.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_49f31c1438b6931034b026c48da0e53f.json
new file mode 100644
index 0000000000..fd8ad60c97
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_49f31c1438b6931034b026c48da0e53f.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_cccc3f586d42f8f32a6d53936edfb88b.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_cccc3f586d42f8f32a6d53936edfb88b.json
new file mode 100644
index 0000000000..859e4dd61f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/update block type_1_cccc3f586d42f8f32a6d53936edfb88b.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_eaf229f04c2670cce6c90b541476b3ed.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_eaf229f04c2670cce6c90b541476b3ed.json
new file mode 100644
index 0000000000..97ff59237c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_eaf229f04c2670cce6c90b541476b3ed.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-1807cb25-01f5-46e5-9fe4-dffee46a0099\",\"object\":\"chat.completion\",\"created\":1743013799,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_hbzr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"Hi, world! Bold the text. Link.\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.100374829,\"prompt_tokens\":580,\"prompt_time\":0.044696916,\"completion_tokens\":35,\"completion_time\":0.127272727,\"total_tokens\":615,\"total_time\":0.171969643},\"system_fingerprint\":\"fp_c4760ee73b\",\"x_groq\":{\"id\":\"req_01jq9vfs6dftc9yw220208650r\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_eba91fcad7b9a1c805978958135b3ad4.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_eba91fcad7b9a1c805978958135b3ad4.json
new file mode 100644
index 0000000000..e51c1d9ee0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_eba91fcad7b9a1c805978958135b3ad4.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-6b808e42-4556-47a7-a8d0-463c1cbc6508\",\"object\":\"chat.completion\",\"created\":1743013798,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_fsq6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"Hello, world! Bold text. Link.\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10132539600000001,\"prompt_tokens\":574,\"prompt_time\":0.036783184,\"completion_tokens\":34,\"completion_time\":0.134820195,\"total_tokens\":608,\"total_time\":0.171603379},\"system_fingerprint\":\"fp_8dd9fca28c\",\"x_groq\":{\"id\":\"req_01jq9vfrt8ftbtqht1dj6hddvc\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_28b7b755035aa1b2e7195c45b57003bf.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_28b7b755035aa1b2e7195c45b57003bf.json
new file mode 100644
index 0000000000..2b694a983a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_28b7b755035aa1b2e7195c45b57003bf.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-1baebe0c-5fba-4c6f-9952-e21ef93ccd86\",\"object\":\"chat.completion\",\"created\":1743013793,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_f137\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"Hello, updated content\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.106769609,\"prompt_tokens\":571,\"prompt_time\":0.039641309,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":600,\"total_time\":0.145095854},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq9vfkmcft8bbsheh504kp1e\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_e342d3eede7e8ec5dbbdfd8bd7d746a2.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_e342d3eede7e8ec5dbbdfd8bd7d746a2.json
new file mode 100644
index 0000000000..abfdf16c11
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_e342d3eede7e8ec5dbbdfd8bd7d746a2.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-f71dcbb8-c6d5-49f4-beb9-3a3c1014c68b\",\"object\":\"chat.completion\",\"created\":1743013795,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_d6qb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"Hello, @John Doe! How are you doing?\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10786142199999998,\"prompt_tokens\":565,\"prompt_time\":0.039908086,\"completion_tokens\":36,\"completion_time\":0.130909091,\"total_tokens\":601,\"total_time\":0.170817177},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq9vfnfheqdrnt122az8kj7s\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_776a434ab32ddce7a101e2df8e1af10c.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_776a434ab32ddce7a101e2df8e1af10c.json
new file mode 100644
index 0000000000..aaa0ca0ff3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_776a434ab32ddce7a101e2df8e1af10c.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-bf4f0981-cbd5-4c82-b2d9-e8c7ff0e9a8f\",\"object\":\"chat.completion\",\"created\":1743013795,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_rajz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"Hello! How **are you doing?**\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.128414565,\"prompt_tokens\":576,\"prompt_time\":0.044704352,\"completion_tokens\":34,\"completion_time\":0.123636364,\"total_tokens\":610,\"total_time\":0.168340716},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq9vfntbftaamzjc8rsm31e2\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_b8b1ab9dcc9ada491bb1d9cba0fb46f6.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_b8b1ab9dcc9ada491bb1d9cba0fb46f6.json
new file mode 100644
index 0000000000..d30b8ce175
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block_1_b8b1ab9dcc9ada491bb1d9cba0fb46f6.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-e8415e12-b0ee-4b4e-b9b7-14a9a7bf96df\",\"object\":\"chat.completion\",\"created\":1743013795,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_vkba\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"Hello, updated content\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10101048,\"prompt_tokens\":571,\"prompt_time\":0.036372642,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":600,\"total_time\":0.141827187},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jq9vfn6cft9rqj8rz4mgks38\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_399a255d195a11330ed8642cb31d1c62.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_399a255d195a11330ed8642cb31d1c62.json
new file mode 100644
index 0000000000..cf5418715e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark_1_399a255d195a11330ed8642cb31d1c62.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-cca2cc0e-e83c-4442-9acd-91bbbb723cb3\",\"object\":\"chat.completion\",\"created\":1743013798,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_00q6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"Hello, **world!**\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":2.387923343,\"prompt_tokens\":568,\"prompt_time\":0.06681274,\"completion_tokens\":31,\"completion_time\":0.112727273,\"total_tokens\":599,\"total_time\":0.179540013},\"system_fingerprint\":\"fp_fcc3b74982\",\"x_groq\":{\"id\":\"req_01jq9vfp6kftb9safz7qkmcp2v\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_0fe9b449a5dc9341fd4292c29a93d5f2.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_0fe9b449a5dc9341fd4292c29a93d5f2.json
new file mode 100644
index 0000000000..77622f5394
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_0fe9b449a5dc9341fd4292c29a93d5f2.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-cf8afb44-85cd-41c6-8510-60f431849761\",\"object\":\"chat.completion\",\"created\":1743013794,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_6330\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"# What's up, world!\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10681216499999999,\"prompt_tokens\":575,\"prompt_time\":0.0413088,\"completion_tokens\":31,\"completion_time\":0.112727273,\"total_tokens\":606,\"total_time\":0.154036073},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq9vfmwbft9bjg1ykwwacyxq\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_eaa3d0f756b26d401823ac7436c5a3aa.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_eaa3d0f756b26d401823ac7436c5a3aa.json
new file mode 100644
index 0000000000..b0c61068b7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_eaa3d0f756b26d401823ac7436c5a3aa.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-cfc38803-b41f-4aa4-b898-24d652e6cb6a\",\"object\":\"chat.completion\",\"created\":1743013794,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_8bjs\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"# Hello, world!\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10097695099999998,\"prompt_tokens\":563,\"prompt_time\":0.041693738,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":592,\"total_time\":0.147148283},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq9vfkz2ft9bpdz378p9t9cw\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_ab99821ce043b00e4e8126b2d28e743f.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_ab99821ce043b00e4e8126b2d28e743f.json
new file mode 100644
index 0000000000..1e80f6cf06
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_ab99821ce043b00e4e8126b2d28e743f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-267af228-a192-488d-9bf8-fe1982b2b6b8\",\"object\":\"chat.completion.chunk\",\"created\":1743013790,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfgpzeqbvfpr1gnhp6c9z\"}}\n\ndata: {\"id\":\"chatcmpl-267af228-a192-488d-9bf8-fe1982b2b6b8\",\"object\":\"chat.completion.chunk\",\"created\":1743013790,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_hjxa\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-267af228-a192-488d-9bf8-fe1982b2b6b8\",\"object\":\"chat.completion.chunk\",\"created\":1743013790,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfgpzeqbvfpr1gnhp6c9z\",\"usage\":{\"queue_time\":0.12947640100000002,\"prompt_tokens\":580,\"prompt_time\":0.047973996,\"completion_tokens\":30,\"completion_time\":0.109090909,\"total_tokens\":610,\"total_time\":0.157064905}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_d2b44f3372b0ffc55d164e7f8e1c67b5.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_d2b44f3372b0ffc55d164e7f8e1c67b5.json
new file mode 100644
index 0000000000..ee78bfc992
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_d2b44f3372b0ffc55d164e7f8e1c67b5.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-6c45a49c-c809-4d40-b7da-359882cae60c\",\"object\":\"chat.completion.chunk\",\"created\":1743014297,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vyx1pf5kv8g5gvfk1854v\"}}\n\ndata: {\"id\":\"chatcmpl-6c45a49c-c809-4d40-b7da-359882cae60c\",\"object\":\"chat.completion.chunk\",\"created\":1743014297,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_v199\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"Hi, world! Bold the text. Link.\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6c45a49c-c809-4d40-b7da-359882cae60c\",\"object\":\"chat.completion.chunk\",\"created\":1743014297,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3884478861\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vyx1pf5kv8g5gvfk1854v\",\"usage\":{\"queue_time\":2.767050556,\"prompt_tokens\":584,\"prompt_time\":0.08430797,\"completion_tokens\":35,\"completion_time\":0.13844869,\"total_tokens\":619,\"total_time\":0.22275666}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_7a9b529bb7803d51b7585b58fbbf5ef3.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_7a9b529bb7803d51b7585b58fbbf5ef3.json
new file mode 100644
index 0000000000..80c3f1e1d7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_7a9b529bb7803d51b7585b58fbbf5ef3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-bd4e224f-54c2-46ac-a0f4-c75e8b96af4d\",\"object\":\"chat.completion.chunk\",\"created\":1743013790,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfezeft69y0w2e1snbxmf\"}}\n\ndata: {\"id\":\"chatcmpl-bd4e224f-54c2-46ac-a0f4-c75e8b96af4d\",\"object\":\"chat.completion.chunk\",\"created\":1743013790,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_f4e1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref3$\\\", \\\"block\\\": \\\"Hello, world! Bold text. Link.\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-bd4e224f-54c2-46ac-a0f4-c75e8b96af4d\",\"object\":\"chat.completion.chunk\",\"created\":1743013790,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfezeft69y0w2e1snbxmf\",\"usage\":{\"queue_time\":1.397405158,\"prompt_tokens\":574,\"prompt_time\":0.070854812,\"completion_tokens\":34,\"completion_time\":0.123636364,\"total_tokens\":608,\"total_time\":0.194491176}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_68f294562d474d18dd97e31d833f0624.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_68f294562d474d18dd97e31d833f0624.json
new file mode 100644
index 0000000000..88818a6d24
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_68f294562d474d18dd97e31d833f0624.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-7d673701-bfc3-4124-b1e3-2bbbbd997359\",\"object\":\"chat.completion.chunk\",\"created\":1743013784,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfb6fff788axj4fv9ghsj\"}}\n\ndata: {\"id\":\"chatcmpl-7d673701-bfc3-4124-b1e3-2bbbbd997359\",\"object\":\"chat.completion.chunk\",\"created\":1743013785,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_h56e\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"Hello, updated content\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-7d673701-bfc3-4124-b1e3-2bbbbd997359\",\"object\":\"chat.completion.chunk\",\"created\":1743013785,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfb6fff788axj4fv9ghsj\",\"usage\":{\"queue_time\":0.129064126,\"prompt_tokens\":571,\"prompt_time\":0.041100322,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":600,\"total_time\":0.146554867}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_8943576967bf8bbed6e4c7d81140f29e.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_8943576967bf8bbed6e4c7d81140f29e.json
new file mode 100644
index 0000000000..f3f51f3c28
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_8943576967bf8bbed6e4c7d81140f29e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-77978b5f-5266-4359-bcb3-0f041b234d0d\",\"object\":\"chat.completion.chunk\",\"created\":1743013787,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfdtaffars9fs6naqh7b3\"}}\n\ndata: {\"id\":\"chatcmpl-77978b5f-5266-4359-bcb3-0f041b234d0d\",\"object\":\"chat.completion.chunk\",\"created\":1743013787,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_z5gq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"Hello, @John Doe! How are you doing?\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-77978b5f-5266-4359-bcb3-0f041b234d0d\",\"object\":\"chat.completion.chunk\",\"created\":1743013787,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfdtaffars9fs6naqh7b3\",\"usage\":{\"queue_time\":0.1072927,\"prompt_tokens\":565,\"prompt_time\":0.037154702,\"completion_tokens\":36,\"completion_time\":0.130909091,\"total_tokens\":601,\"total_time\":0.168063793}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_33fc1ffc23a5096fcbd0c6bf25227f26.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_33fc1ffc23a5096fcbd0c6bf25227f26.json
new file mode 100644
index 0000000000..0e0038438a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_33fc1ffc23a5096fcbd0c6bf25227f26.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-f3137d38-1b39-4052-890a-b5a53af92939\",\"object\":\"chat.completion.chunk\",\"created\":1743013787,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfe5hffb9eehyz20hbqzq\"}}\n\ndata: {\"id\":\"chatcmpl-f3137d38-1b39-4052-890a-b5a53af92939\",\"object\":\"chat.completion.chunk\",\"created\":1743013788,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_7wrs\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"Hello! How **are you doing?**\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f3137d38-1b39-4052-890a-b5a53af92939\",\"object\":\"chat.completion.chunk\",\"created\":1743013788,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_90c1d253ff\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfe5hffb9eehyz20hbqzq\",\"usage\":{\"queue_time\":0.101320568,\"prompt_tokens\":576,\"prompt_time\":0.043151604,\"completion_tokens\":34,\"completion_time\":0.123636364,\"total_tokens\":610,\"total_time\":0.166787968}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_d827bd60af645af820f94b7d324c558b.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_d827bd60af645af820f94b7d324c558b.json
new file mode 100644
index 0000000000..197d899d3d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block_1_d827bd60af645af820f94b7d324c558b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-b8e87256-5df8-4993-b92f-3b2726f4910a\",\"object\":\"chat.completion.chunk\",\"created\":1743013787,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfc69ff999d7zgpy6r75h\"}}\n\ndata: {\"id\":\"chatcmpl-b8e87256-5df8-4993-b92f-3b2726f4910a\",\"object\":\"chat.completion.chunk\",\"created\":1743013787,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_t9jh\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref2$\\\", \\\"block\\\": \\\"Hello, updated content\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b8e87256-5df8-4993-b92f-3b2726f4910a\",\"object\":\"chat.completion.chunk\",\"created\":1743013787,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_fcc3b74982\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfc69ff999d7zgpy6r75h\",\"usage\":{\"queue_time\":1.2832811579999999,\"prompt_tokens\":571,\"prompt_time\":0.087951125,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":600,\"total_time\":0.19340567}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_6fae9c4d733d38fb6f1746f6a05d11d7.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_6fae9c4d733d38fb6f1746f6a05d11d7.json
new file mode 100644
index 0000000000..b7fe1113b6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark_1_6fae9c4d733d38fb6f1746f6a05d11d7.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-819012db-e37e-4815-8bd0-8be671d47867\",\"object\":\"chat.completion.chunk\",\"created\":1743013788,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfemdeq9s1g22sc164b1j\"}}\n\ndata: {\"id\":\"chatcmpl-819012db-e37e-4815-8bd0-8be671d47867\",\"object\":\"chat.completion.chunk\",\"created\":1743013788,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_yv8s\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, **world!**\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-819012db-e37e-4815-8bd0-8be671d47867\",\"object\":\"chat.completion.chunk\",\"created\":1743013788,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfemdeq9s1g22sc164b1j\",\"usage\":{\"queue_time\":0.10117880700000001,\"prompt_tokens\":568,\"prompt_time\":0.0442282,\"completion_tokens\":26,\"completion_time\":0.094545455,\"total_tokens\":594,\"total_time\":0.138773655}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_c923199006c9da30bd3158a9e73943ee.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_c923199006c9da30bd3158a9e73943ee.json
new file mode 100644
index 0000000000..6834cb3e62
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_c923199006c9da30bd3158a9e73943ee.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-74b677c8-72aa-4d2e-8020-a0745cdd0c78\",\"object\":\"chat.completion.chunk\",\"created\":1743013785,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfbveft3sejpbpc5kc67f\"}}\n\ndata: {\"id\":\"chatcmpl-74b677c8-72aa-4d2e-8020-a0745cdd0c78\",\"object\":\"chat.completion.chunk\",\"created\":1743013785,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_w6d3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"# What's up, world!\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-74b677c8-72aa-4d2e-8020-a0745cdd0c78\",\"object\":\"chat.completion.chunk\",\"created\":1743013785,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfbveft3sejpbpc5kc67f\",\"usage\":{\"queue_time\":0.10110524199999998,\"prompt_tokens\":575,\"prompt_time\":0.036553829,\"completion_tokens\":31,\"completion_time\":0.112727273,\"total_tokens\":606,\"total_time\":0.149281102}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_041ac8922695cec6e801e8667e1ce819.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_041ac8922695cec6e801e8667e1ce819.json
new file mode 100644
index 0000000000..c1a6627275
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_041ac8922695cec6e801e8667e1ce819.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d5868040-e45e-43e3-b2ed-923cc116ec6b\",\"object\":\"chat.completion.chunk\",\"created\":1743013785,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfbgvff7rf3d5r8pyh0s0\"}}\n\ndata: {\"id\":\"chatcmpl-d5868040-e45e-43e3-b2ed-923cc116ec6b\",\"object\":\"chat.completion.chunk\",\"created\":1743013785,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_psfq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"ref1$\\\", \\\"block\\\": \\\"# Hello, world!\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d5868040-e45e-43e3-b2ed-923cc116ec6b\",\"object\":\"chat.completion.chunk\",\"created\":1743013785,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfbgvff7rf3d5r8pyh0s0\",\"usage\":{\"queue_time\":0.12941509499999998,\"prompt_tokens\":563,\"prompt_time\":0.04904035,\"completion_tokens\":29,\"completion_time\":0.105454545,\"total_tokens\":592,\"total_time\":0.154494895}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_c6346cd0be6c33d2d43a355a4f14d8fe.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_c6346cd0be6c33d2d43a355a4f14d8fe.json
new file mode 100644
index 0000000000..6ad2d7a774
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_c6346cd0be6c33d2d43a355a4f14d8fe.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnODCoJqUpzSjhB9EM5Ro15mYcx\",\n \"object\": \"chat.completion\",\n \"created\": 1743013778,\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_Hkl77dHbhm4gP6V5VvFnEgh6\",\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\": 287,\n \"completion_tokens\": 29,\n \"total_tokens\": 316,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ec9bda4b800d56eeb4dd84c5f60f3c32.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ec9bda4b800d56eeb4dd84c5f60f3c32.json
new file mode 100644
index 0000000000..f8c0cc7b5a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_ec9bda4b800d56eeb4dd84c5f60f3c32.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKqqmDJDdTcOpXukF22JhYcRRl1\",\n \"object\": \"chat.completion\",\n \"created\": 1743081200,\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_AcunvV99qQszdDdWSwQS6y5A\",\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\": 291,\n \"completion_tokens\": 29,\n \"total_tokens\": 320,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_661bf1d191a6afbc34150c4e9fec74d5.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_661bf1d191a6afbc34150c4e9fec74d5.json
new file mode 100644
index 0000000000..3da0d1e76b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_661bf1d191a6afbc34150c4e9fec74d5.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnNVkUqdIKGe3drCZCP4juk4O1W\",\n \"object\": \"chat.completion\",\n \"created\": 1743013777,\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_25ykcCWmduRO79ZmwcBA7elr\",\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\": 281,\n \"completion_tokens\": 28,\n \"total_tokens\": 309,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_d50d33bd18723f099bf3675ec8489ac0.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_d50d33bd18723f099bf3675ec8489ac0.json
new file mode 100644
index 0000000000..9470d3785c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_d50d33bd18723f099bf3675ec8489ac0.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKpCQKOzoj2ZZ8aR6JwbmUnFM8Y\",\n \"object\": \"chat.completion\",\n \"created\": 1743081199,\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_kYc4QPYgr3CeD1ZvCTp6UCgq\",\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\": 285,\n \"completion_tokens\": 28,\n \"total_tokens\": 313,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_9a1a392df02d8a51983ca11bebe84f38.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_9a1a392df02d8a51983ca11bebe84f38.json
new file mode 100644
index 0000000000..01b6b7afd9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_9a1a392df02d8a51983ca11bebe84f38.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKjrCyaK4KumT7kzWAzVRyFMcUA\",\n \"object\": \"chat.completion\",\n \"created\": 1743081193,\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_B4X4Ui6xQ4GywonWwg8JQfcl\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"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\": 282,\n \"completion_tokens\": 23,\n \"total_tokens\": 305,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_df74ee944c5bb55e006e79d02e4397ae.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_df74ee944c5bb55e006e79d02e4397ae.json
new file mode 100644
index 0000000000..f98011dff2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_df74ee944c5bb55e006e79d02e4397ae.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnFQjuu7tCRSFiQ1ul35Hro1p7g\",\n \"object\": \"chat.completion\",\n \"created\": 1743013769,\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_ALZKTsdYSJgyQsmU4rANtG8p\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"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\": 278,\n \"completion_tokens\": 23,\n \"total_tokens\": 301,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_1c2dda6b7dc1df719b5dee69cb692b4d.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_1c2dda6b7dc1df719b5dee69cb692b4d.json
new file mode 100644
index 0000000000..19f7a0e193
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_1c2dda6b7dc1df719b5dee69cb692b4d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnK9BQ3y9HnqKrX4nIMx0TKrsgz\",\n \"object\": \"chat.completion\",\n \"created\": 1743013774,\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_tbOdpwapS803NKtm1lqyvCS5\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing?\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 272,\n \"completion_tokens\": 30,\n \"total_tokens\": 302,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_d7140e2e4423cb0b71eabbe414718c5a.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_d7140e2e4423cb0b71eabbe414718c5a.json
new file mode 100644
index 0000000000..b9793ef172
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_d7140e2e4423cb0b71eabbe414718c5a.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKmBUqxsCLkzyy3faVV2T16mhTP\",\n \"object\": \"chat.completion\",\n \"created\": 1743081196,\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_H9tlMt92Swhv6AbukpFkBpS6\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing?\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 276,\n \"completion_tokens\": 30,\n \"total_tokens\": 306,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_4e1549a1dd3719ffc649d8d488671449.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_4e1549a1dd3719ffc649d8d488671449.json
new file mode 100644
index 0000000000..6ef4c2f180
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_4e1549a1dd3719ffc649d8d488671449.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKnk95KtnyepAD8F4FBmMyuY5mh\",\n \"object\": \"chat.completion\",\n \"created\": 1743081197,\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_TzIBuSHDrkYR6xuDloUdFaC5\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How **are you doing?**\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 287,\n \"completion_tokens\": 28,\n \"total_tokens\": 315,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_86f8dff66120f99b54e939fbca6b5d9e.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_86f8dff66120f99b54e939fbca6b5d9e.json
new file mode 100644
index 0000000000..f8187c4f8b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_86f8dff66120f99b54e939fbca6b5d9e.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnL1MRGNCZKMU3GoeTH6prwQwI4\",\n \"object\": \"chat.completion\",\n \"created\": 1743013775,\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_Kf4zbim25B1PjZ3bYeQ11mxS\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How **are you doing?**\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 283,\n \"completion_tokens\": 28,\n \"total_tokens\": 311,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_36a887fb36b470ff4eb73924e4d0b3b3.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_36a887fb36b470ff4eb73924e4d0b3b3.json
new file mode 100644
index 0000000000..24f69f68a6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_36a887fb36b470ff4eb73924e4d0b3b3.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnIJGAiOh1TNIfvid6gOtPGcEOv\",\n \"object\": \"chat.completion\",\n \"created\": 1743013772,\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_AQ6rvQtylzHL6qNIE3YjVESW\",\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\": 278,\n \"completion_tokens\": 23,\n \"total_tokens\": 301,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_854ed16f686ee8356eaa9af577697d8b.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_854ed16f686ee8356eaa9af577697d8b.json
new file mode 100644
index 0000000000..a809d55f6f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block_1_854ed16f686ee8356eaa9af577697d8b.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKlZQuiiqrF8T2YLNAIvbYFzaT0\",\n \"object\": \"chat.completion\",\n \"created\": 1743081195,\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_1cuQZkler7Cjgw30ni8hHF0l\",\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\": 282,\n \"completion_tokens\": 23,\n \"total_tokens\": 305,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_ab3f002bfb31fc114976dbd2a8632d80.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_ab3f002bfb31fc114976dbd2a8632d80.json
new file mode 100644
index 0000000000..90af65c9aa
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_ab3f002bfb31fc114976dbd2a8632d80.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnMTLv4ufSJaD1l7XzSIIpktMSw\",\n \"object\": \"chat.completion\",\n \"created\": 1743013776,\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_SQD7V6o0OcqEJ9p5hFC7jtRM\",\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\": 275,\n \"completion_tokens\": 25,\n \"total_tokens\": 300,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_fc570467a80b6d8b808c9e1ff1abe28a.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_fc570467a80b6d8b808c9e1ff1abe28a.json
new file mode 100644
index 0000000000..b01d89839a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark_1_fc570467a80b6d8b808c9e1ff1abe28a.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKoKXGwrEFlRagRDN00pZmMfnNu\",\n \"object\": \"chat.completion\",\n \"created\": 1743081198,\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_nP7ev4NuhKVhkyN0mPqRsd4u\",\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\": 279,\n \"completion_tokens\": 25,\n \"total_tokens\": 304,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8bdba6632398c317eaa28547bd6f185e.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8bdba6632398c317eaa28547bd6f185e.json
new file mode 100644
index 0000000000..90bab83c5b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_8bdba6632398c317eaa28547bd6f185e.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKkwHuIMurQQr47Jrp9IWMZLhI5\",\n \"object\": \"chat.completion\",\n \"created\": 1743081194,\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_LTsFNYtTAYEka2QMXh2U5sra\",\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\": 285,\n \"completion_tokens\": 25,\n \"total_tokens\": 310,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_bf8928ba8af72b82b30a9c56c343d642.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_bf8928ba8af72b82b30a9c56c343d642.json
new file mode 100644
index 0000000000..6e3f3e213a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_bf8928ba8af72b82b30a9c56c343d642.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnHZCQ9ujDaMDxFO5ehEJ1ufBjR\",\n \"object\": \"chat.completion\",\n \"created\": 1743013771,\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_1W8Zxhx1ljMxBdP1s95oI9mz\",\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\": 281,\n \"completion_tokens\": 25,\n \"total_tokens\": 306,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_7c4ebe89982d6b1de54d437bef42d980.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_7c4ebe89982d6b1de54d437bef42d980.json
new file mode 100644
index 0000000000..89f6c9df5d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_7c4ebe89982d6b1de54d437bef42d980.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnG6XvBmJfUZUE6MjTp2Sz50hp9\",\n \"object\": \"chat.completion\",\n \"created\": 1743013770,\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_hNbsKGNXfv6jjRBqespSiFJO\",\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\": 270,\n \"completion_tokens\": 24,\n \"total_tokens\": 294,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_c9280cf02d03d6299b29ad105b39b452.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_c9280cf02d03d6299b29ad105b39b452.json
new file mode 100644
index 0000000000..0047cdb75e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_c9280cf02d03d6299b29ad105b39b452.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhKjBNVazmKYIumSuB4HbkAs3QTP\",\n \"object\": \"chat.completion\",\n \"created\": 1743081193,\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_0xgMfoag1K0pOb103jzVf8IG\",\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\": 274,\n \"completion_tokens\": 24,\n \"total_tokens\": 298,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9905d201d97f3cc9c0b6af6be39899ef.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9905d201d97f3cc9c0b6af6be39899ef.json
new file mode 100644
index 0000000000..343d222838
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_9905d201d97f3cc9c0b6af6be39899ef.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_YMucWRFRrqH8MBw3jbGcIWbV\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7g29YggzoaQzYeocNtg5zmXF7n\",\"object\":\"chat.completion.chunk\",\"created\":1743061164,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_b418fbe951a68389652fb650d7bd5367.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_b418fbe951a68389652fb650d7bd5367.json
new file mode 100644
index 0000000000..976e905566
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_b418fbe951a68389652fb650d7bd5367.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ABFYujmypLOsyHkiWy9PC1rz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn5fewsVNcO8FeJhMw2JeG1ZADo\",\"object\":\"chat.completion.chunk\",\"created\":1743013759,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_5d9745fe92375c0dae7d5e383f618cba.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_5d9745fe92375c0dae7d5e383f618cba.json
new file mode 100644
index 0000000000..cc51e65f7b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_5d9745fe92375c0dae7d5e383f618cba.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_jRrQLRqs1KAlRIIIxcUg8jtr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn4h3QJRcTE0HGGQ7RCH1BJHV7h\",\"object\":\"chat.completion.chunk\",\"created\":1743013758,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_fd182736b2d8c9eb566f0d47254ccf9f.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_fd182736b2d8c9eb566f0d47254ccf9f.json
new file mode 100644
index 0000000000..4186f0fd6d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_fd182736b2d8c9eb566f0d47254ccf9f.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_4whTOoWQbM5BgcMnrj9g5XpU\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7fgGP2Y4Lrd15hhQ39raRPvtFg\",\"object\":\"chat.completion.chunk\",\"created\":1743061163,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_6bf03e2ad088c3d948532ba192647791.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_6bf03e2ad088c3d948532ba192647791.json
new file mode 100644
index 0000000000..2a02a9cec7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_6bf03e2ad088c3d948532ba192647791.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ulLJYBNUetoxfsxvz0jDDidS\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7Z1HfR4SZ5AYYpuKjAidGYhS1b\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_808e70a4debb636e15240338595ed346.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_808e70a4debb636e15240338595ed346.json
new file mode 100644
index 0000000000..c15a6718ef
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_808e70a4debb636e15240338595ed346.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the first 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Jf3svmmcBPDY9zYbWfHMUC65\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmxpyD5K1wnI1dSaGA3f2d3j6Yg\",\"object\":\"chat.completion.chunk\",\"created\":1743013751,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_4136243b1643cabda2c05fe3fe4b16a2.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_4136243b1643cabda2c05fe3fe4b16a2.json
new file mode 100644
index 0000000000..8eaeb82550
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_4136243b1643cabda2c05fe3fe4b16a2.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_PlvXzRFoEZIkWoaJ7OaggYdu\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" @\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7csSoWfphUIv34dsV2k32qNkLg\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_6f4b42247146f2bd9036d90518eae516.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_6f4b42247146f2bd9036d90518eae516.json
new file mode 100644
index 0000000000..aea8d9876a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_6f4b42247146f2bd9036d90518eae516.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_DWXn3dv6H5L0timckWKgHUBB\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" @\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn1XSGuA7kzzfhR7YKEIDgdSTH5\",\"object\":\"chat.completion.chunk\",\"created\":1743013755,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_a18e3968aceb1aa13f932576f644dc5c.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_a18e3968aceb1aa13f932576f644dc5c.json
new file mode 100644
index 0000000000..b572bd033c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_a18e3968aceb1aa13f932576f644dc5c.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_mOxQ5bqzcVXtFBxDK7I6psWU\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" **\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7dGgxgAkNHArHsbG1R0N4qyMAj\",\"object\":\"chat.completion.chunk\",\"created\":1743061161,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_edfb808ea74227aea59da28cdd06375d.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_edfb808ea74227aea59da28cdd06375d.json
new file mode 100644
index 0000000000..2896e050b4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_edfb808ea74227aea59da28cdd06375d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing?' (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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_lc4saLF15e9WpUDzldi0OJjw\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" **\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"are\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn2qPDdgHuscVxzKqjOMn7ingTW\",\"object\":\"chat.completion.chunk\",\"created\":1743013756,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_06386e3f798883d6e805d8681aa47f69.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_06386e3f798883d6e805d8681aa47f69.json
new file mode 100644
index 0000000000..b7b36b7057
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_06386e3f798883d6e805d8681aa47f69.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_1KCU1glkMBmhK28qNpkS3p7A\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7cWYA0fdwLtQfAszpeeCFORrKm\",\"object\":\"chat.completion.chunk\",\"created\":1743061160,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_d4ba514bb5e5248d496bb72bf1868f74.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_d4ba514bb5e5248d496bb72bf1868f74.json
new file mode 100644
index 0000000000..6ddcbdcf5f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block_1_d4ba514bb5e5248d496bb72bf1868f74.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ALFTbwJckrrlejW4oZyei6H6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn0fiT1DFN926HT2FIcQdfwXCir\",\"object\":\"chat.completion.chunk\",\"created\":1743013754,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_66eed1ad840f7d085a22233ad55b9731.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_66eed1ad840f7d085a22233ad55b9731.json
new file mode 100644
index 0000000000..f73a252b9e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_66eed1ad840f7d085a22233ad55b9731.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_PKBm9gtuiufZ0qN5hdUK6QqS\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" **\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7eLgZzXcPIV6jFbCukXp9L1n8c\",\"object\":\"chat.completion.chunk\",\"created\":1743061162,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_7d624e0a5120297e2d957aae59aff4c8.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_7d624e0a5120297e2d957aae59aff4c8.json
new file mode 100644
index 0000000000..f98f3b7195
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark_1_7d624e0a5120297e2d957aae59aff4c8.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_xTq1XyniqyhZcA2yzRxBx0cU\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" **\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPn3XbLhHUuMAPm6IHybddz32Pzh\",\"object\":\"chat.completion.chunk\",\"created\":1743013757,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_3c45796f25345f355089ba6313e77fa7.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_3c45796f25345f355089ba6313e77fa7.json
new file mode 100644
index 0000000000..9076b1531f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_3c45796f25345f355089ba6313e77fa7.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_71sLVGd6DLGpREivRKuAvc6W\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"#\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7balWaxwmq5iFjpd5TOp8OvCQd\",\"object\":\"chat.completion.chunk\",\"created\":1743061159,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a037fb755aa53e4ea24a0b653f715146.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a037fb755aa53e4ea24a0b653f715146.json
new file mode 100644
index 0000000000..f1b45cae13
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_a037fb755aa53e4ea24a0b653f715146.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_jOcvixoxEq9hUo1cpn2bWsPO\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"#\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" What's\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmzWjVCR2uQvJToFPBg5NjlWQwX\",\"object\":\"chat.completion.chunk\",\"created\":1743013753,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_446f19dc159e8f131395a83e6f0b21ce.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_446f19dc159e8f131395a83e6f0b21ce.json
new file mode 100644
index 0000000000..3b8f70aaf6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_446f19dc159e8f131395a83e6f0b21ce.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_ofKaMNtiXSst95rzBTCiTVvx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"#\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7a94mzbfZGKTCdi5XNWteeD58z\",\"object\":\"chat.completion.chunk\",\"created\":1743061158,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_9a532648b0e2eb404d9fce2764b4f2aa.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_9a532648b0e2eb404d9fce2764b4f2aa.json
new file mode 100644
index 0000000000..054dc6b0fd
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update (formatting)/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_9a532648b0e2eb404d9fce2764b4f2aa.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!\\\"},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How **are you doing?**\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! **Bold text. **[Link.](https://www.google.com)\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_m59QGQnTBO3DRDKkQMS9wPDI\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"#\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmyHSn3F4vXGJGyEp7tYoZeOptU\",\"object\":\"chat.completion.chunk\",\"created\":1743013752,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes block type (paragraph -> heading)_1_5bbbc54729da2c86eae65a52db8936ef.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes block type (paragraph -> heading)_1_5bbbc54729da2c86eae65a52db8936ef.json
new file mode 100644
index 0000000000..eca77cbbce
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes block type (paragraph -> heading)_1_5bbbc54729da2c86eae65a52db8936ef.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes simple formatting (paragraph)_1_b1d8b8f26ffe62c841facba991d06642.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes simple formatting (paragraph)_1_b1d8b8f26ffe62c841facba991d06642.json
new file mode 100644
index 0000000000..97077b2edf
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes simple formatting (paragraph)_1_b1d8b8f26ffe62c841facba991d06642.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes simple formatting (word)_1_d08ce5bdae64b39f2eace73e6006d73c.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes simple formatting (word)_1_d08ce5bdae64b39f2eace73e6006d73c.json
new file mode 100644
index 0000000000..ca3904cbb6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/changes simple formatting (word)_1_d08ce5bdae64b39f2eace73e6006d73c.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello world\\\"}]\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/translates simple paragraphs_1_6c3d8c8032cdab683a88bd223ea8e3de.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/translates simple paragraphs_1_6c3d8c8032cdab683a88bd223ea8e3de.json
new file mode 100644
index 0000000000..f86bc0e3a8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/translates simple paragraphs_1_6c3d8c8032cdab683a88bd223ea8e3de.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://localhost:3000/ai?provider=albert-etalab&url=https%3A%2F%2Falbert.api.etalab.gouv.fr%2Fv1%2Fchat%2Fcompletions",
+ "body": "{\"model\":\"neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 400,
+ "statusText": "",
+ "body": "{\"detail\":\"The provided JSON schema contains features not supported by xgrammar.\"}",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_1ddd8ff07663fd6dc7765e34a57cda4d.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_1ddd8ff07663fd6dc7765e34a57cda4d.json
new file mode 100644
index 0000000000..6375faca47
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes block type (paragraph -> heading)_1_1ddd8ff07663fd6dc7765e34a57cda4d.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-8346800b-7955-4d2d-951c-90109cee8bc2\",\"object\":\"chat.completion\",\"created\":1743013792,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_psnb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"# Hello\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.10155847400000001,\"prompt_tokens\":518,\"prompt_time\":0.040063724,\"completion_tokens\":21,\"completion_time\":0.087885856,\"total_tokens\":539,\"total_time\":0.12794958},\"system_fingerprint\":\"fp_90c1d253ff\",\"x_groq\":{\"id\":\"req_01jq9vfjewft8bmrzh3xrzv4dm\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_bcf6b52478ebf0fd97c8bda9fc784a55.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_bcf6b52478ebf0fd97c8bda9fc784a55.json
new file mode 100644
index 0000000000..6daf8ac3ee
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (paragraph)_1_bcf6b52478ebf0fd97c8bda9fc784a55.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-586e8b87-af3c-4d81-b0aa-cf16f02ff21e\",\"object\":\"chat.completion\",\"created\":1743013792,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_xjp8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": \\\"**Hello**\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.129882942,\"prompt_tokens\":517,\"prompt_time\":0.045396312,\"completion_tokens\":26,\"completion_time\":0.094545455,\"total_tokens\":543,\"total_time\":0.139941767},\"system_fingerprint\":\"fp_b1483399f5\",\"x_groq\":{\"id\":\"req_01jq9vfjt3eqbsr53fcs686r28\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_7a8fd29796f789cf59a81913cdca39cc.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_7a8fd29796f789cf59a81913cdca39cc.json
new file mode 100644
index 0000000000..fab20b78b8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/changes simple formatting (word)_1_7a8fd29796f789cf59a81913cdca39cc.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello world\\\"}]\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-8e84e08f-f872-472a-8775-b68d8258b649\",\"object\":\"chat.completion\",\"created\":1743013793,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_0xjr\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": \\\"**Hello** world\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.107606566,\"prompt_tokens\":509,\"prompt_time\":0.032806341,\"completion_tokens\":27,\"completion_time\":0.098181818,\"total_tokens\":536,\"total_time\":0.130988159},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq9vfk6aeqbvqbg4ymr04q8b\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_c131f42c60a0fcd5e10e38144a8d6892.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_c131f42c60a0fcd5e10e38144a8d6892.json
new file mode 100644
index 0000000000..234354cdc2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translates simple paragraphs_1_c131f42c60a0fcd5e10e38144a8d6892.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\"id\":\"chatcmpl-d0104f60-fd8f-4d95-b817-8aaef4b00adc\",\"object\":\"chat.completion\",\"created\":1743013791,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"call_cqrb\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": \\\"Hallo\\\"}, {\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"1$\\\", \\\"block\\\": \\\"Welt\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.101114133,\"prompt_tokens\":517,\"prompt_time\":0.040942794,\"completion_tokens\":44,\"completion_time\":0.16,\"total_tokens\":561,\"total_time\":0.200942794},\"system_fingerprint\":\"fp_41c250edc7\",\"x_groq\":{\"id\":\"req_01jq9vfj3geqbrj4cwpfa8y6rr\"}}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_459158d5de670ae41170275790efe40f.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_459158d5de670ae41170275790efe40f.json
new file mode 100644
index 0000000000..b398e7d8af
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes block type (paragraph -> heading)_1_459158d5de670ae41170275790efe40f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-bf281494-81f2-4cdd-bec2-9ed2bf377f9b\",\"object\":\"chat.completion.chunk\",\"created\":1743013783,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfa3cft3aw0ekb4a15rv6\"}}\n\ndata: {\"id\":\"chatcmpl-bf281494-81f2-4cdd-bec2-9ed2bf377f9b\",\"object\":\"chat.completion.chunk\",\"created\":1743013783,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_eh2z\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"# Hello\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-bf281494-81f2-4cdd-bec2-9ed2bf377f9b\",\"object\":\"chat.completion.chunk\",\"created\":1743013783,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_c4760ee73b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfa3cft3aw0ekb4a15rv6\",\"usage\":{\"queue_time\":0.100782493,\"prompt_tokens\":518,\"prompt_time\":0.035098835,\"completion_tokens\":21,\"completion_time\":0.093282808,\"total_tokens\":539,\"total_time\":0.128381643}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_6a17ee08b7600b6f7962a42cc0a5fb76.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_6a17ee08b7600b6f7962a42cc0a5fb76.json
new file mode 100644
index 0000000000..4b93fafa06
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (paragraph)_1_6a17ee08b7600b6f7962a42cc0a5fb76.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-65fd319e-03cb-4b8f-ad3f-4d2c204e40da\",\"object\":\"chat.completion.chunk\",\"created\":1743013784,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfacaft39rz8wqkjfh9mz\"}}\n\ndata: {\"id\":\"chatcmpl-65fd319e-03cb-4b8f-ad3f-4d2c204e40da\",\"object\":\"chat.completion.chunk\",\"created\":1743013784,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_cd5g\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": \\\"**Hello**\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-65fd319e-03cb-4b8f-ad3f-4d2c204e40da\",\"object\":\"chat.completion.chunk\",\"created\":1743013784,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfacaft39rz8wqkjfh9mz\",\"usage\":{\"queue_time\":0.100572914,\"prompt_tokens\":517,\"prompt_time\":0.074327871,\"completion_tokens\":26,\"completion_time\":0.094545455,\"total_tokens\":543,\"total_time\":0.168873326}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_0b3695193b4bc884fdaca4bef0db238f.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_0b3695193b4bc884fdaca4bef0db238f.json
new file mode 100644
index 0000000000..3661c7c8ba
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/changes simple formatting (word)_1_0b3695193b4bc884fdaca4bef0db238f.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello world\\\"}]\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-04c4a2ec-a2c5-4a20-abfc-98da0d60b2e8\",\"object\":\"chat.completion.chunk\",\"created\":1743013784,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vfasvff6skgg1z2j308b3\"}}\n\ndata: {\"id\":\"chatcmpl-04c4a2ec-a2c5-4a20-abfc-98da0d60b2e8\",\"object\":\"chat.completion.chunk\",\"created\":1743013784,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_53np\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": \\\"**Hello** world\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-04c4a2ec-a2c5-4a20-abfc-98da0d60b2e8\",\"object\":\"chat.completion.chunk\",\"created\":1743013784,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_b1483399f5\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vfasvff6skgg1z2j308b3\",\"usage\":{\"queue_time\":0.130141305,\"prompt_tokens\":509,\"prompt_time\":0.043084713,\"completion_tokens\":27,\"completion_time\":0.098181818,\"total_tokens\":536,\"total_time\":0.141266531}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_67a2b5a13103f36e1a0fae4bd52f206b.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_67a2b5a13103f36e1a0fae4bd52f206b.json
new file mode 100644
index 0000000000..362dcb9ec1
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translates simple paragraphs_1_67a2b5a13103f36e1a0fae4bd52f206b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-ebd2403d-54f8-4c2c-b733-0bc92949cfd6\",\"object\":\"chat.completion.chunk\",\"created\":1743013783,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01jq9vf9r1ff6v00p4xvv7d0jn\"}}\n\ndata: {\"id\":\"chatcmpl-ebd2403d-54f8-4c2c-b733-0bc92949cfd6\",\"object\":\"chat.completion.chunk\",\"created\":1743013783,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"call_2b28\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\": [{\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"0$\\\", \\\"block\\\": \\\"Hallo\\\"}, {\\\"type\\\": \\\"update\\\", \\\"id\\\": \\\"1$\\\", \\\"block\\\": \\\"Welt\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ebd2403d-54f8-4c2c-b733-0bc92949cfd6\",\"object\":\"chat.completion.chunk\",\"created\":1743013783,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_41c250edc7\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01jq9vf9r1ff6v00p4xvv7d0jn\",\"usage\":{\"queue_time\":0.100823991,\"prompt_tokens\":517,\"prompt_time\":0.043007609,\"completion_tokens\":44,\"completion_time\":0.16,\"total_tokens\":561,\"total_time\":0.203007609}}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_452d319981d5a519c6358930fdbda755.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_452d319981d5a519c6358930fdbda755.json
new file mode 100644
index 0000000000..bd2c564eb7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes block type (paragraph -> heading)_1_452d319981d5a519c6358930fdbda755.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnCszDGljMCpUHEJMPrdZPbbMV7\",\n \"object\": \"chat.completion\",\n \"created\": 1743013766,\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_WJJyy0u4ZJGD7mMPzXNjct8x\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"# Hello\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 225,\n \"completion_tokens\": 20,\n \"total_tokens\": 245,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_1885fc862cefe4c15707d8d10d546be4.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_1885fc862cefe4c15707d8d10d546be4.json
new file mode 100644
index 0000000000..b54300b8d8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (paragraph)_1_1885fc862cefe4c15707d8d10d546be4.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnDWScX9unCD20a5HXFkkMbZrLO\",\n \"object\": \"chat.completion\",\n \"created\": 1743013767,\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_tpPgKvyt1PdtQuhebQYVzf3j\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"**Hello**\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 224,\n \"completion_tokens\": 21,\n \"total_tokens\": 245,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_75255425ea2b0fe181c9ac878e209e11.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_75255425ea2b0fe181c9ac878e209e11.json
new file mode 100644
index 0000000000..3fbb70971b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/changes simple formatting (word)_1_75255425ea2b0fe181c9ac878e209e11.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello world\\\"}]\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnELOJAjmFRfnMiTWBzpUfgWe06\",\n \"object\": \"chat.completion\",\n \"created\": 1743013768,\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_p2Vd4IxOFWfZC5ig0vkecHpj\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"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\": 216,\n \"completion_tokens\": 22,\n \"total_tokens\": 238,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates paragraph with formatting_1_286855bd1a49d5d677070eb290b64e41.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates paragraph with formatting_1_286855bd1a49d5d677070eb290b64e41.json
new file mode 100644
index 0000000000..8b89b19314
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates paragraph with formatting_1_286855bd1a49d5d677070eb290b64e41.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello world, **this is some bold** and some colored text\\\"}]\"},{\"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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFhOZTdKknYFPjAccampZ70xdUVSM\",\n \"object\": \"chat.completion\",\n \"created\": 1743081431,\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_fyCQwFTEnV33wrKAZVK0LYdt\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hallo Welt, **das ist etwas Fettgedrucktes** und etwas farbiger Text\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 229,\n \"completion_tokens\": 36,\n \"total_tokens\": 265,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_bd47c95b85fb9beee7d9279fd140476f.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_bd47c95b85fb9beee7d9279fd140476f.json
new file mode 100644
index 0000000000..df0efc28ac
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_bd47c95b85fb9beee7d9279fd140476f.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFc7OaaQTSh92eJVcQupoZeWJJf6Y\",\n \"object\": \"chat.completion\",\n \"created\": 1743061146,\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_jjyDHOgiQDiMRPjhPwfcSoaU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hallo\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"Welt\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 228,\n \"completion_tokens\": 33,\n \"total_tokens\": 261,\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_898ac29719\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_ca9771506d6a4f2a9a3abba331a35614.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_ca9771506d6a4f2a9a3abba331a35614.json
new file mode 100644
index 0000000000..d98c01f8a6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translates simple paragraphs_1_ca9771506d6a4f2a9a3abba331a35614.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}]}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "{\n \"id\": \"chatcmpl-BFPnA8T6kORAWrgX3g7lHzpA6LLFA\",\n \"object\": \"chat.completion\",\n \"created\": 1743013764,\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_KLCVlZ9ReFTnNI6MvI9EWtU0\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hallo\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"Welt\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 224,\n \"completion_tokens\": 33,\n \"total_tokens\": 257,\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_c1e1ac6736\"\n}\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_065fe767e99f51fc800c1dd099d00009.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_065fe767e99f51fc800c1dd099d00009.json
new file mode 100644
index 0000000000..4c61c47a02
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_065fe767e99f51fc800c1dd099d00009.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_K8JtFJOoFuY6vMTvUTxIZxmo\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"#\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7X9DWtVTtaLXzQe2njGUtU7VUI\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_7c904010a589d44d907534216e45fcaa.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_7c904010a589d44d907534216e45fcaa.json
new file mode 100644
index 0000000000..1436de9718
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes block type (paragraph -> heading)_1_7c904010a589d44d907534216e45fcaa.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_3qdvvYSwipdFOecS4dwbPWF8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"#\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmsm3M3X6xArs6ja179FT44vzwh\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_930b1e729e0b50f4735a8b7dc0ace112.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_930b1e729e0b50f4735a8b7dc0ace112.json
new file mode 100644
index 0000000000..069ecad368
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_930b1e729e0b50f4735a8b7dc0ace112.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_GiHjj0GL922lNzjhmv5cFUQH\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7XPpObBkIodnktqCj4GJ5NdPxQ\",\"object\":\"chat.completion.chunk\",\"created\":1743061155,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_e39a2e6823a9141be63885d0f6a9eb27.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_e39a2e6823a9141be63885d0f6a9eb27.json
new file mode 100644
index 0000000000..cc6cdb91fa
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (paragraph)_1_e39a2e6823a9141be63885d0f6a9eb27.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"change first paragraph to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Gh4qojQal6kVnkRHfDledlpv\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmtkQQqN4FTB2cg8SBgZnAyTQU1\",\"object\":\"chat.completion.chunk\",\"created\":1743013747,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_37e729dc1592ee88dca44d0e8863e781.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_37e729dc1592ee88dca44d0e8863e781.json
new file mode 100644
index 0000000000..d2509d47e6
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_37e729dc1592ee88dca44d0e8863e781.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello world\\\"}]\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_18M9ZLjZnKXstXaPjIY1ESl5\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmwSUat0d9mw1ATMjw7zeITszDg\",\"object\":\"chat.completion.chunk\",\"created\":1743013750,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_e95cbafee2032a211f07a60ccd9b594b.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_e95cbafee2032a211f07a60ccd9b594b.json
new file mode 100644
index 0000000000..427aa6bcd9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/changes simple formatting (word)_1_e95cbafee2032a211f07a60ccd9b594b.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello world\\\"}]\"},{\"role\":\"user\",\"content\":\"change first word to 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_xlL2K6MQo9A7EKmNFpIzbfTG\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"**\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFc7ZDeVlKJhlHK1B6AR7c2Np1hVF\",\"object\":\"chat.completion.chunk\",\"created\":1743061157,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_2e88c5b5df521c8274917d959677771b.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_2e88c5b5df521c8274917d959677771b.json
new file mode 100644
index 0000000000..13915cc315
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_2e88c5b5df521c8274917d959677771b.json
@@ -0,0 +1,15 @@
+{
+ "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. Make sure to follow the json schema provided. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_OrV53vUs2xZmqBOxCbZ9a6su\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"W\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"elt\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFPmschL1rsb5J84kglea5TMDh847\",\"object\":\"chat.completion.chunk\",\"created\":1743013746,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_c1e1ac6736\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_3b950ac24dac73a7f08069776b81f09f.json b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_3b950ac24dac73a7f08069776b81f09f.json
new file mode 100644
index 0000000000..6460948769
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/__snapshots__/markdownBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translates simple paragraphs_1_3b950ac24dac73a7f08069776b81f09f.json
@@ -0,0 +1,15 @@
+{
+ "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, use the tools provided to manipulate the markdown representation of the document. This is the document as an array of blocks in markdown:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"0$\\\",\\\"block\\\":\\\"Hello\\\"},{\\\"id\\\":\\\"1$\\\",\\\"block\\\":\\\"World\\\"}]\"},{\"role\":\"user\",\"content\":\"translate existing document 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, the new block will replace the existing block.\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"$ref\":\"#/$defs/block\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"Whether new block(s) should be inserted before or after `referenceId`\"},\"blocks\":{\"items\":{\"$ref\":\"#/$defs/block\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"],\"$defs\":{\"block\":{\"type\":\"string\",\"description\":\"markdown of block\"}}}}}],\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_DwcOtjNPKeOEk6ACm2dtOFLi\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"0\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"W\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"elt\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-BFZ5CUAfgSq0kdFOr2nxzi1ThqwMw\",\"object\":\"chat.completion.chunk\",\"created\":1743049478,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_898ac29719\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..02943034ae
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts
@@ -0,0 +1,145 @@
+import { afterAll, afterEach, beforeAll, describe } from "vitest";
+
+import { getCurrentTest } from "@vitest/runner";
+import { getSortedEntries, snapshot, toHashString } from "msw-snapshot";
+import { setupServer } from "msw/node";
+import path from "path";
+import { testAIModels } from "../../../testUtil/testAIModels.js";
+import { generateSharedTestCases } from "../tests/sharedTestCases.js";
+import { callLLM } from "./markdownBlocks.js";
+
+const BASE_FILE_PATH = path.resolve(
+ __dirname,
+ "__snapshots__",
+ path.basename(__filename)
+);
+
+// TODO: disable delays in applyOperations
+
+const fetchCountMap: Record = {};
+
+async function createRequestHash(req: Request) {
+ const url = new URL(req.url);
+ return [
+ // url.host,
+ // url.pathname,
+ toHashString([
+ req.method,
+ url.origin,
+ url.pathname,
+ getSortedEntries(url.searchParams),
+ getSortedEntries(req.headers),
+ // getSortedEntries(req.cookies),
+ new TextDecoder("utf-8").decode(await req.arrayBuffer()),
+ ]),
+ ].join("/");
+}
+
+// Main test suite with snapshot middleware
+describe("Models", () => {
+ // Define server with snapshot middleware for the main tests
+ const server = setupServer(
+ snapshot({
+ updateSnapshots: "missing",
+ // onSnapshotUpdated: "all",
+ // ignoreSnapshots: true,
+ async createSnapshotPath(info) {
+ // use a unique path for each model
+ const t = getCurrentTest()!;
+ const mswPath = path.join(
+ t.suite!.name, // same directory as the test snapshot
+ "__msw_snapshots__",
+ t.suite!.suite!.name, // model / streaming params
+ t.name
+ );
+ // in case there are multiple requests in a test, we need to use a separate snapshot for each request
+ fetchCountMap[mswPath] = (fetchCountMap[mswPath] || 0) + 1;
+ const hash = await createRequestHash(info.request);
+ return mswPath + `_${fetchCountMap[mswPath]}_${hash}.json`;
+ },
+ basePath: BASE_FILE_PATH,
+ // onFetchFromSnapshot(info, snapshot) {
+ // console.log("onFetchFromSnapshot", info, snapshot);
+ // },
+ // onFetchFromServer(info, snapshot) {
+ // console.log("onFetchFromServer", info, snapshot);
+ // },
+ })
+ );
+
+ beforeAll(() => {
+ server.listen();
+ });
+
+ afterAll(() => {
+ server.close();
+ });
+
+ afterEach(() => {
+ delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
+ });
+
+ const testMatrix = [
+ {
+ model: testAIModels.openai,
+ stream: true,
+ },
+ {
+ model: testAIModels.openai,
+ stream: false,
+ },
+ {
+ model: testAIModels.groq,
+ stream: true,
+ },
+ {
+ model: testAIModels.groq,
+ stream: false,
+ },
+ // TODO: https://github.com/vercel/ai/issues/5350
+ // {
+ // model: albert,
+ // stream: true,
+ // },
+ {
+ model: testAIModels.albert,
+ stream: false,
+ },
+
+ // {
+ // model: groq,
+ // },
+ // // {
+ // // model: albert,
+ // // stream: true,
+ // // },
+ ];
+
+ for (const params of testMatrix) {
+ describe(`${params.model.provider}/${params.model.modelId} (${
+ params.stream ? "streaming" : "non-streaming"
+ })`, () => {
+ generateSharedTestCases(
+ (editor, options) =>
+ callLLM(editor, {
+ ...options,
+ model: params.model,
+ maxRetries: 0,
+ stream: params.stream,
+ // _generateObjectOptions: {
+ // providerOptions: {
+ // "albert-etalab": {
+ // guided_decoding_backend: "outlines",
+ // },
+ // },
+ // },
+ }),
+ // markdownblocks doesn't support these:
+ {
+ mentions: true,
+ textAlignment: 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
new file mode 100644
index 0000000000..95e83e3644
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts
@@ -0,0 +1,198 @@
+import { Block, BlockNoteEditor } from "@blocknote/core";
+import { generateObject, streamObject } from "ai";
+import type { PromptOrMessages } from "../../index.js";
+import {
+ promptManipulateDocumentUseMarkdownBlocks,
+ promptManipulateSelectionMarkdownBlocks,
+} from "../../prompts/markdownBlocksPrompt.js";
+import {
+ generateOperations,
+ LLMRequestOptions,
+ streamOperations,
+} from "../../streamTool/callLLMWithStreamTools.js";
+import { StreamTool } from "../../streamTool/streamTool.js";
+import { isEmptyParagraph } from "../../util/emptyBlock.js";
+
+import { CallLLMResult } from "../CallLLMResult.js";
+import {
+ getDataForPromptNoSelection,
+ getDataForPromptWithSelection,
+} from "./markdownPromptData.js";
+import { tools } from "./tools/index.js";
+
+// TODO: this file is a copy from htmlBlocks.ts, we should refactor to share code?
+
+async function getMessages(
+ editor: BlockNoteEditor,
+ opts: {
+ selectedBlocks?: Block[];
+ excludeBlockIds?: string[];
+ } & PromptOrMessages,
+) {
+ // TODO: child blocks
+ // TODO: document how to customize prompt
+ if ("messages" in opts && opts.messages) {
+ return opts.messages;
+ } else if (opts.selectedBlocks) {
+ if (opts.excludeBlockIds) {
+ throw new Error(
+ "expected excludeBlockIds to be false when selectedBlocks is provided",
+ );
+ }
+ return promptManipulateSelectionMarkdownBlocks({
+ ...(await getDataForPromptWithSelection(editor, opts.selectedBlocks)),
+ userPrompt: opts.userPrompt,
+ });
+ } else {
+ if (opts.useSelection) {
+ throw new Error(
+ "expected useSelection to be false when selectedBlocks is not provided",
+ );
+ }
+ return promptManipulateDocumentUseMarkdownBlocks({
+ ...(await getDataForPromptNoSelection(editor, {
+ excludeBlockIds: opts.excludeBlockIds,
+ })),
+ userPrompt: opts.userPrompt,
+ });
+ }
+}
+
+function getStreamTools(
+ 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,
+ };
+
+ const streamTools: StreamTool[] = [
+ ...(mergedStreamTools.update
+ ? [
+ tools.update(editor, {
+ idsSuffixed: true,
+ withDelays,
+ updateSelection: selectionInfo,
+ }),
+ ]
+ : []),
+ ...(mergedStreamTools.add
+ ? [tools.add(editor, { idsSuffixed: true, withDelays })]
+ : []),
+ ...(mergedStreamTools.delete
+ ? [tools.delete(editor, { idsSuffixed: true, withDelays })]
+ : []),
+ ];
+
+ return streamTools;
+}
+
+export async function callLLM(
+ editor: BlockNoteEditor,
+ opts: Omit &
+ PromptOrMessages & {
+ 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;
+ };
+ stream?: boolean;
+ deleteEmptyCursorBlock?: boolean;
+ onStart?: () => void;
+ withDelays?: boolean;
+ _generateObjectOptions?: Partial<
+ Parameters>[0]
+ >;
+ _streamObjectOptions?: Partial>[0]>;
+ },
+): Promise {
+ const {
+ userPrompt: prompt,
+ useSelection,
+ deleteEmptyCursorBlock,
+ stream,
+ onStart,
+ withDelays,
+ ...rest
+ } = {
+ deleteEmptyCursorBlock: true,
+ stream: true,
+ withDelays: true,
+ ...opts,
+ };
+
+ const cursorBlock = useSelection
+ ? undefined
+ : editor.getTextCursorPosition().block;
+
+ const deleteCursorBlock: string | undefined =
+ cursorBlock && deleteEmptyCursorBlock && isEmptyParagraph(cursorBlock)
+ ? cursorBlock.id
+ : undefined;
+
+ const selectionInfo = useSelection ? editor.getSelection2() : undefined;
+
+ const messages = await getMessages(editor, {
+ ...opts,
+ selectedBlocks: selectionInfo?.blocks,
+ excludeBlockIds: deleteCursorBlock ? [deleteCursorBlock] : undefined,
+ });
+
+ const streamTools = getStreamTools(
+ editor,
+ withDelays,
+ opts.defaultStreamTools,
+ selectionInfo
+ ? { from: selectionInfo._meta.startPos, to: selectionInfo._meta.endPos }
+ : undefined,
+ );
+
+ let response:
+ | Awaited>>
+ | Awaited>>;
+
+ if (stream || stream === undefined) {
+ response = await streamOperations(
+ streamTools,
+ {
+ messages,
+ ...rest,
+ },
+ () => {
+ if (deleteCursorBlock) {
+ editor.removeBlocks([deleteCursorBlock]);
+ }
+ onStart?.();
+ },
+ );
+ } else {
+ response = await generateOperations(streamTools, {
+ messages,
+ ...rest,
+ });
+ if (deleteCursorBlock) {
+ editor.removeBlocks([deleteCursorBlock]);
+ }
+ onStart?.();
+ }
+
+ return new CallLLMResult(response, streamTools);
+}
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts
new file mode 100644
index 0000000000..271fe5676a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts
@@ -0,0 +1,37 @@
+import {
+ Block,
+ BlockNoteEditor
+} from "@blocknote/core";
+import { addCursorPosition } from "../../prompts/promptHelpers/addCursorPosition.js";
+import { convertBlocks } from "../../prompts/promptHelpers/convertBlocks.js";
+import { suffixIDs } from "../../prompts/promptHelpers/suffixIds.js";
+import { trimEmptyBlocks } from "../../prompts/promptHelpers/trimEmptyBlocks.js";
+
+ export async function getDataForPromptNoSelection(editor: BlockNoteEditor, opts: {
+ excludeBlockIds?: string[]
+ }) {
+ const input = trimEmptyBlocks(editor.document);
+ const blockArray = await convertBlocks(input, async (block) => {
+ return editor.blocksToMarkdownLossy([block]);
+ });
+ const withCursor = addCursorPosition(editor, blockArray);
+ const filtered = withCursor.filter(b => "cursor" in b || !(opts.excludeBlockIds || []).includes(b.id));
+ const suffixed = suffixIDs(filtered);
+ return {
+ markdownBlocks: suffixed,
+ };
+ }
+
+ export async function getDataForPromptWithSelection(editor: BlockNoteEditor, selectedBlocks: Block[]) {
+ const htmlArray = await convertBlocks(selectedBlocks, async (block) => {
+ return editor.blocksToMarkdownLossy([block]);
+ });
+ const suffixed = suffixIDs(htmlArray);
+
+ return {
+ markdownSelectedBlocks: suffixed,
+ markdownDocument: (await convertBlocks(editor.document, async (block) => {
+ return editor.blocksToMarkdownLossy([block]);
+ })).map(({ block }) => ({block})), // strip ids so LLM can't accidentally issue updates to ids not in selection
+ };
+ }
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/tools/index.ts b/packages/xl-ai/src/api/formats/markdown-blocks/tools/index.ts
new file mode 100644
index 0000000000..1692231766
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/tools/index.ts
@@ -0,0 +1,80 @@
+import { PartialBlock } from "@blocknote/core";
+import {
+ AddBlocksToolCall,
+ createAddBlocksTool,
+} from "../../../tools/createAddBlocksTool.js";
+import {
+ createUpdateBlockTool,
+ UpdateBlockToolCall,
+} from "../../../tools/createUpdateBlockTool.js";
+import { deleteBlockTool } from "../../../tools/delete.js";
+import { createMDRebaseTool } from "./rebaseTool.js";
+import { validateBlockFunction } from "./validate.js";
+
+export const tools = {
+ add: createAddBlocksTool({
+ description: "Insert new blocks",
+ schema: {
+ block: {
+ $ref: "#/$defs/block",
+ },
+ $defs: {
+ block: { type: "string", description: "markdown of block" },
+ },
+ },
+ validateBlock: validateBlockFunction,
+ rebaseTool: createMDRebaseTool,
+ toJSONToolCall: async (editor, chunk) => {
+ const blocks = await Promise.all(
+ chunk.operation.blocks.map(async (md) => {
+ const block = (await editor.tryParseMarkdownToBlocks(md.trim()))[0]; // TODO: trim
+ delete (block as any).id;
+ return block;
+ }),
+ );
+
+ // hacky
+ if ((window as any).__TEST_OPTIONS) {
+ (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS.mockID = 0;
+ }
+
+ return {
+ ...chunk.operation,
+ blocks,
+ } satisfies AddBlocksToolCall>;
+ },
+ }),
+ update: createUpdateBlockTool({
+ description:
+ "Update a block, the new block will replace the existing block.",
+ schema: {
+ block: {
+ $ref: "#/$defs/block",
+ },
+ $defs: {
+ block: { type: "string", description: "markdown of block" },
+ },
+ },
+ validateBlock: validateBlockFunction,
+ rebaseTool: createMDRebaseTool,
+ toJSONToolCall: async (editor, chunk) => {
+ const block = (
+ await editor.tryParseMarkdownToBlocks(chunk.operation.block.trim())
+ )[0];
+
+ delete (block as any).id;
+ // console.log("update", operation.block);
+ // console.log("md", block);
+ // hacky
+ if ((window as any).__TEST_OPTIONS) {
+ (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS.mockID = 0;
+ }
+
+ return {
+ ...chunk.operation,
+ block,
+ } satisfies UpdateBlockToolCall>;
+ },
+ }),
+ delete: deleteBlockTool,
+};
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/tools/rebaseTool.ts b/packages/xl-ai/src/api/formats/markdown-blocks/tools/rebaseTool.ts
new file mode 100644
index 0000000000..a2b0ed2876
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/tools/rebaseTool.ts
@@ -0,0 +1,36 @@
+import { BlockNoteEditor, getBlock } from "@blocknote/core";
+import { Mapping } from "prosemirror-transform";
+import { updateToReplaceSteps } from "../../../../prosemirror/changeset.js";
+import {
+ getApplySuggestionsTr,
+ rebaseTool,
+} from "../../../../prosemirror/rebaseTool.js";
+
+export async function createMDRebaseTool(
+ id: string,
+ editor: BlockNoteEditor,
+) {
+ const tr = getApplySuggestionsTr(editor);
+ const md = await editor.blocksToMarkdownLossy([getBlock(tr.doc, id)!]);
+ const blocks = await editor.tryParseMarkdownToBlocks(md);
+
+ const steps = updateToReplaceSteps(
+ {
+ id,
+ block: blocks[0],
+ type: "update",
+ },
+ tr.doc,
+ );
+
+ const stepMapping = new Mapping();
+ for (const step of steps) {
+ const mapped = step.map(stepMapping);
+ if (!mapped) {
+ throw new Error("Failed to map step");
+ }
+ tr.step(mapped);
+ stepMapping.appendMap(mapped.getMap());
+ }
+ return rebaseTool(editor, tr);
+}
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/tools/validate.ts b/packages/xl-ai/src/api/formats/markdown-blocks/tools/validate.ts
new file mode 100644
index 0000000000..35ffd27e42
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/tools/validate.ts
@@ -0,0 +1,15 @@
+import { InvalidOrOk } from "../../../streamTool/streamTool.js";
+
+export function validateBlockFunction(block: any): InvalidOrOk {
+ if (typeof block !== "string") {
+ return {
+ result: "invalid",
+ reason: "block must be a string",
+ };
+ }
+
+ return {
+ result: "ok",
+ value: block,
+ };
+}
diff --git a/packages/xl-ai/src/api/formats/markdown/markdown.test.ts b/packages/xl-ai/src/api/formats/markdown/markdown.test.ts
new file mode 100644
index 0000000000..cb90122ee2
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown/markdown.test.ts
@@ -0,0 +1,109 @@
+import { afterAll, afterEach, beforeAll, describe } from "vitest";
+
+import { getCurrentTest } from "@vitest/runner";
+import { getSortedEntries, snapshot, toHashString } from "msw-snapshot";
+import { setupServer } from "msw/node";
+import path from "path";
+import { testAIModels } from "../../../testUtil/testAIModels.js";
+import { generateSharedTestCases } from "../tests/sharedTestCases.js";
+import { callLLM } from "./markdown.js";
+
+// Create client and models outside of test suites so they can be shared
+
+const BASE_FILE_PATH = path.resolve(
+ __dirname,
+ "__snapshots__",
+ path.basename(__filename)
+);
+
+// TODO: disable delays in applyOperations
+
+const fetchCountMap: Record = {};
+
+async function createRequestHash(req: Request) {
+ const url = new URL(req.url);
+ return [
+ // url.host,
+ // url.pathname,
+ toHashString([
+ req.method,
+ url.origin,
+ url.pathname,
+ getSortedEntries(url.searchParams),
+ getSortedEntries(req.headers),
+ // getSortedEntries(req.cookies),
+ new TextDecoder("utf-8").decode(await req.arrayBuffer()),
+ ]),
+ ].join("/");
+}
+
+// Main test suite with snapshot middleware
+describe("Models", () => {
+ // Define server with snapshot middleware for the main tests
+ const server = setupServer(
+ snapshot({
+ updateSnapshots: "missing",
+ // onSnapshotUpdated: "all",
+ // ignoreSnapshots: true,
+ async createSnapshotPath(info) {
+ // use a unique path for each model
+ const t = getCurrentTest()!;
+ const mswPath = path.join(
+ t.suite!.name, // same directory as the test snapshot
+ "__msw_snapshots__",
+ t.suite!.suite!.name, // model / streaming params
+ t.name
+ );
+ // in case there are multiple requests in a test, we need to use a separate snapshot for each request
+ fetchCountMap[mswPath] = (fetchCountMap[mswPath] || 0) + 1;
+ const hash = await createRequestHash(info.request);
+ return mswPath + `_${fetchCountMap[mswPath]}_${hash}.json`;
+ },
+ basePath: BASE_FILE_PATH,
+ // onFetchFromSnapshot(info, snapshot) {
+ // console.log("onFetchFromSnapshot", info, snapshot);
+ // },
+ // onFetchFromServer(info, snapshot) {
+ // console.log("onFetchFromServer", info, snapshot);
+ // },
+ })
+ );
+
+ beforeAll(() => {
+ server.listen();
+ });
+
+ afterAll(() => {
+ server.close();
+ });
+
+ afterEach(() => {
+ delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
+ });
+
+ const testMatrix = [
+ {
+ model: testAIModels.openai,
+ },
+
+ {
+ model: testAIModels.groq,
+ },
+ // {
+ // model: albert,
+ // stream: true,
+ // },
+ ];
+
+ for (const params of testMatrix) {
+ describe(`${params.model.provider}/${params.model.modelId}`, () => {
+ generateSharedTestCases((editor, options) =>
+ callLLM(editor, {
+ ...options,
+ model: params.model,
+ maxRetries: 0,
+ })
+ );
+ });
+ }
+});
diff --git a/packages/xl-ai/src/api/formats/markdown/markdown.ts b/packages/xl-ai/src/api/formats/markdown/markdown.ts
new file mode 100644
index 0000000000..f7d7759cef
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/markdown/markdown.ts
@@ -0,0 +1,118 @@
+import { BlockNoteEditor } from "@blocknote/core";
+import { CoreMessage, LanguageModel, generateText } from "ai";
+import { markdownNodeDiff } from "../../../markdown/markdownNodeDiff.js";
+import { markdownNodeDiffToBlockOperations } from "../../../markdown/markdownOperations.js";
+import {
+ getApplySuggestionsTr,
+ rebaseTool,
+} from "../../../prosemirror/rebaseTool.js";
+import { applyOperations } from "../../executor/streamOperations/applyOperations.js";
+import type { PromptOrMessages } from "../../index.js";
+import {
+ promptManipulateDocumentUseMarkdown,
+ promptManipulateDocumentUseMarkdownWithSelection,
+} from "../../prompts/markdownPrompts.js";
+import {
+ asyncIterableToStream,
+ createAsyncIterableStream,
+} from "../../util/stream.js";
+import { trimArray } from "../../util/trimArray.js";
+
+type BasicLLMRequestOptions = {
+ model: LanguageModel;
+ maxRetries?: number;
+} & PromptOrMessages;
+
+type MarkdownLLMRequestOptions = BasicLLMRequestOptions & {
+ _generateTextOptions?: Partial>[0]>;
+};
+
+export async function callLLM(
+ editor: BlockNoteEditor,
+ options: MarkdownLLMRequestOptions
+) {
+ let messages: CoreMessage[];
+ // TODO: add test with empty paragraphs at end, this should break without trim()
+ const markdown = (await editor.blocksToMarkdownLossy()).trim();
+
+ if ("messages" in options && options.messages) {
+ messages = options.messages;
+ } else if (options.useSelection) {
+ const selection = editor.getDocumentWithSelectionMarkers();
+ const markdown = (await editor.blocksToMarkdownLossy(selection)).trim();
+ messages = promptManipulateDocumentUseMarkdownWithSelection({
+ editor,
+ markdown,
+ userPrompt: (options as any).prompt,
+ });
+ } else {
+ messages = promptManipulateDocumentUseMarkdown({
+ editor,
+ markdown,
+ userPrompt: (options as any).prompt,
+ });
+ }
+
+ const withDefaults: Required<
+ Omit
+ > = {
+ messages,
+ maxRetries: 2,
+ ...(options as any), // TODO
+ };
+
+ const ret = await generateText({
+ model: withDefaults.model,
+ messages: withDefaults.messages,
+ maxRetries: withDefaults.maxRetries,
+ ...options._generateTextOptions,
+ });
+
+ const blocks = trimArray(editor.document, (block) => {
+ return (
+ block.type === "paragraph" &&
+ Array.isArray(block.content) &&
+ block.content.length === 0
+ );
+ });
+ const newMarkdown = ret.text.trim();
+ // Test\n\nHello
+ const diff = await markdownNodeDiff(markdown, newMarkdown);
+ const operations = await markdownNodeDiffToBlockOperations(
+ editor,
+ blocks,
+ diff
+ );
+
+ async function* singleChunkGenerator() {
+ for (const operation of operations) {
+ yield {
+ operation,
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+ }
+ }
+
+ const resultGenerator = applyOperations(
+ editor,
+ singleChunkGenerator(),
+ async (_id) => {
+ return rebaseTool(editor, getApplySuggestionsTr(editor));
+ }
+ );
+
+ // Convert to stream at the API boundary
+ const resultStream = asyncIterableToStream(resultGenerator);
+ const asyncIterableResultStream = createAsyncIterableStream(resultStream);
+
+ return {
+ resultStream: asyncIterableResultStream,
+ async apply() {
+ /* eslint-disable-next-line */
+ for await (const _result of asyncIterableResultStream) {
+ // no op
+ }
+ },
+ };
+}
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Delete/deletes a paragraph.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Delete/deletes a paragraph.json
new file mode 100644
index 0000000000..5ebf605cee
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Delete/deletes a paragraph.json
@@ -0,0 +1,19 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "World",
+ "type": "text",
+ },
+ ],
+ "id": "1",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Insert/inserts a paragraph at end.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Insert/inserts a paragraph at end.json
new file mode 100644
index 0000000000..9b06f9fa1b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Insert/inserts a paragraph at end.json
@@ -0,0 +1,36 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "Hello",
+ "type": "text",
+ },
+ ],
+ "id": "0",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "Test",
+ "type": "text",
+ },
+ ],
+ "id": "1",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Insert/inserts a paragraph at start.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Insert/inserts a paragraph at start.json
new file mode 100644
index 0000000000..0975b7aeb9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Insert/inserts a paragraph at start.json
@@ -0,0 +1,36 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "Test",
+ "type": "text",
+ },
+ ],
+ "id": "1",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "Hello",
+ "type": "text",
+ },
+ ],
+ "id": "0",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/drop mark and link and change text within mark.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/drop mark and link and change text within mark.json
new file mode 100644
index 0000000000..0b460a7b22
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/drop mark and link and change text within mark.json
@@ -0,0 +1,218 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Hello",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Hi",
+ "type": "text",
+ },
+ {
+ "text": ", world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Bold the",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": " text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": " text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/drop mark and link.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/drop mark and link.json
new file mode 100644
index 0000000000..7987976828
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/drop mark and link.json
@@ -0,0 +1,167 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/plain source block, add mention.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/plain source block, add mention.json
new file mode 100644
index 0000000000..0e646251d4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/plain source block, add mention.json
@@ -0,0 +1,161 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "world",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "Jane Doe",
+ },
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "type": "mention",
+ },
+ {
+ "text": "!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove column.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove column.json
new file mode 100644
index 0000000000..5e9635ce10
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove column.json
@@ -0,0 +1,289 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 1",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 2",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 3",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 4",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Table Cell Bold 5",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 6",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 7",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 8",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 9",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ ],
+ "type": "table",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove last row.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove last row.json
new file mode 100644
index 0000000000..866ab5977b
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove last row.json
@@ -0,0 +1,275 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 1",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 2",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 3",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 4",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Table Cell Bold 5",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 6",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 7",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 8",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 9",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "type": "tableRow",
+ },
+ ],
+ "type": "table",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove row.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove row.json
new file mode 100644
index 0000000000..feae3118cd
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/remove row.json
@@ -0,0 +1,273 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 1",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 2",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 3",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 4",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Table Cell Bold 5",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 6",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 7",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 8",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 9",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ ],
+ "type": "table",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/standard update.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/standard update.json
new file mode 100644
index 0000000000..4cf65926be
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/standard update.json
@@ -0,0 +1,187 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "H",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "e",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "a",
+ "type": "text",
+ },
+ {
+ "text": "llo, ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "world",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Welt",
+ "type": "text",
+ },
+ {
+ "text": "!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, remove mark.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, remove mark.json
new file mode 100644
index 0000000000..88c9e6ff71
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, remove mark.json
@@ -0,0 +1,149 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, remove mention.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, remove mention.json
new file mode 100644
index 0000000000..362dce7d42
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, remove mention.json
@@ -0,0 +1,151 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": ", ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, replace content.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, replace content.json
new file mode 100644
index 0000000000..abfed580e0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, replace content.json
@@ -0,0 +1,171 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "type": "mention",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "updated content",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, update mention prop.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, update mention prop.json
new file mode 100644
index 0000000000..d25d75fa10
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, update mention prop.json
@@ -0,0 +1,153 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "type": "mention",
+ },
+ {
+ "attrs": {
+ "user": "Jane Doe",
+ },
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, update text.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, update text.json
new file mode 100644
index 0000000000..7f9b605a1f
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in source block, update text.json
@@ -0,0 +1,240 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "H",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "e",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "a",
+ "type": "text",
+ },
+ {
+ "text": "llo, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Wie ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "geht es dir? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "Mir ist zumute nach Blau",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in target block, add mark (paragraph).json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in target block, add mark (paragraph).json
new file mode 100644
index 0000000000..b7e67bb2ec
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in target block, add mark (paragraph).json
@@ -0,0 +1,154 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in target block, add mark (word).json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in target block, add mark (word).json
new file mode 100644
index 0000000000..a142458864
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/styles + ic in target block, add mark (word).json
@@ -0,0 +1,158 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "world!",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "world!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block prop and content.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block prop and content.json
new file mode 100644
index 0000000000..3fa565049d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block prop and content.json
@@ -0,0 +1,167 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "right",
+ },
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Hello",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "What's up",
+ "type": "text",
+ },
+ {
+ "text": ", world!",
+ "type": "text",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "attrName": "textAlignment",
+ "id": null,
+ "newValue": "right",
+ "previousValue": "left",
+ "type": "attr",
+ },
+ "type": "modification",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block prop.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block prop.json
new file mode 100644
index 0000000000..5b76ec592e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block prop.json
@@ -0,0 +1,143 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "right",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "attrName": "textAlignment",
+ "id": null,
+ "newValue": "right",
+ "previousValue": "left",
+ "type": "attr",
+ },
+ "type": "modification",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block type and content.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block type and content.json
new file mode 100644
index 0000000000..29cfecb001
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block type and content.json
@@ -0,0 +1,178 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "level": 1,
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Hello",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "What's up",
+ "type": "text",
+ },
+ {
+ "text": ", world!",
+ "type": "text",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "attrName": null,
+ "id": null,
+ "newValue": "heading",
+ "previousValue": "paragraph",
+ "type": "nodeType",
+ },
+ "type": "modification",
+ },
+ {
+ "attrs": {
+ "attrName": "level",
+ "id": null,
+ "newValue": 1,
+ "previousValue": null,
+ "type": "attr",
+ },
+ "type": "modification",
+ },
+ ],
+ "type": "heading",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block type.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block type.json
new file mode 100644
index 0000000000..1eecb7b3cc
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update block type.json
@@ -0,0 +1,154 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "level": 1,
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "marks": [
+ {
+ "attrs": {
+ "attrName": null,
+ "id": null,
+ "newValue": "heading",
+ "previousValue": "paragraph",
+ "type": "nodeType",
+ },
+ "type": "modification",
+ },
+ {
+ "attrs": {
+ "attrName": "level",
+ "id": null,
+ "newValue": 1,
+ "previousValue": null,
+ "type": "attr",
+ },
+ "type": "modification",
+ },
+ ],
+ "type": "heading",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref2",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, ",
+ "type": "text",
+ },
+ {
+ "attrs": {
+ "user": "John Doe",
+ },
+ "type": "mention",
+ },
+ {
+ "text": "! How ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "are you doing? ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "stringValue": "blue",
+ },
+ "type": "textColor",
+ },
+ ],
+ "text": "I'm feeling blue!",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref3",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "attrs": {
+ "textAlignment": "left",
+ },
+ "content": [
+ {
+ "text": "Hello, world! ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Bold text. ",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "class": null,
+ "href": "https://www.google.com",
+ "rel": "noopener noreferrer nofollow",
+ "target": "_blank",
+ },
+ "type": "link",
+ },
+ ],
+ "text": "Link.",
+ "type": "text",
+ },
+ ],
+ "type": "paragraph",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update table cell.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update table cell.json
new file mode 100644
index 0000000000..670c557226
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update table cell.json
@@ -0,0 +1,263 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 1",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 2",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 3",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 4",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Table Cell Bold 5",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 6",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 7",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 8",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 9",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ ],
+ "type": "table",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update table to caps.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update table to caps.json
new file mode 100644
index 0000000000..670c557226
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update (formatting)/update table to caps.json
@@ -0,0 +1,263 @@
+{
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "id": "ref1",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "deletion",
+ },
+ ],
+ "text": "Table Cell 1",
+ "type": "text",
+ },
+ {
+ "marks": [
+ {
+ "attrs": {
+ "id": null,
+ },
+ "type": "insertion",
+ },
+ ],
+ "text": "Hello, world!",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 2",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 3",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 4",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "marks": [
+ {
+ "type": "bold",
+ },
+ ],
+ "text": "Table Cell Bold 5",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 6",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ {
+ "content": [
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 7",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 8",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ {
+ "attrs": {
+ "backgroundColor": "default",
+ "colspan": 1,
+ "colwidth": null,
+ "rowspan": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "content": [
+ {
+ "content": [
+ {
+ "text": "Table Cell 9",
+ "type": "text",
+ },
+ ],
+ "type": "tableParagraph",
+ },
+ ],
+ "type": "tableCell",
+ },
+ ],
+ "type": "tableRow",
+ },
+ ],
+ "type": "table",
+ },
+ ],
+ "type": "blockContainer",
+ },
+ ],
+ "type": "blockGroup",
+ },
+ ],
+ "type": "doc",
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes block type (paragraph -> heading).json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes block type (paragraph -> heading).json
new file mode 100644
index 0000000000..bce964c4f9
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes block type (paragraph -> heading).json
@@ -0,0 +1,37 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "Hello",
+ "type": "text",
+ },
+ ],
+ "id": "0",
+ "props": {
+ "backgroundColor": "default",
+ "level": 1,
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "heading",
+ },
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "World",
+ "type": "text",
+ },
+ ],
+ "id": "1",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (paragraph).json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (paragraph).json
new file mode 100644
index 0000000000..04d724d220
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (paragraph).json
@@ -0,0 +1,38 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {
+ "bold": true,
+ },
+ "text": "Hello",
+ "type": "text",
+ },
+ ],
+ "id": "0",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "World",
+ "type": "text",
+ },
+ ],
+ "id": "1",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (test).json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (test).json
new file mode 100644
index 0000000000..04d724d220
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (test).json
@@ -0,0 +1,38 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {
+ "bold": true,
+ },
+ "text": "Hello",
+ "type": "text",
+ },
+ ],
+ "id": "0",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "World",
+ "type": "text",
+ },
+ ],
+ "id": "1",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (word).json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (word).json
new file mode 100644
index 0000000000..5ef0183e22
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/changes simple formatting (word).json
@@ -0,0 +1,26 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {
+ "bold": true,
+ },
+ "text": "Hello",
+ "type": "text",
+ },
+ {
+ "styles": {},
+ "text": " world",
+ "type": "text",
+ },
+ ],
+ "id": "0",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/translates paragraph with formatting.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/translates paragraph with formatting.json
new file mode 100644
index 0000000000..6fb1586c98
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/translates paragraph with formatting.json
@@ -0,0 +1,38 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "Hallo Welt, ",
+ "type": "text",
+ },
+ {
+ "styles": {
+ "bold": true,
+ },
+ "text": "das ist etwas Fettgedrucktes",
+ "type": "text",
+ },
+ {
+ "styles": {},
+ "text": " und etwas ",
+ "type": "text",
+ },
+ {
+ "styles": {
+ "textColor": "red",
+ },
+ "text": " farbiger Text",
+ "type": "text",
+ },
+ ],
+ "id": "0",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/translates simple paragraphs.json b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/translates simple paragraphs.json
new file mode 100644
index 0000000000..2bbdb27662
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/__snapshots__/Update/translates simple paragraphs.json
@@ -0,0 +1,36 @@
+[
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "Hallo",
+ "type": "text",
+ },
+ ],
+ "id": "0",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+ {
+ "children": [],
+ "content": [
+ {
+ "styles": {},
+ "text": "Welt",
+ "type": "text",
+ },
+ ],
+ "id": "1",
+ "props": {
+ "backgroundColor": "default",
+ "textAlignment": "left",
+ "textColor": "default",
+ },
+ "type": "paragraph",
+ },
+]
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/tests/checkMswSnapshots.test.ts b/packages/xl-ai/src/api/formats/tests/checkMswSnapshots.test.ts
new file mode 100644
index 0000000000..d249b56ef1
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/checkMswSnapshots.test.ts
@@ -0,0 +1,64 @@
+import * as glob from "glob";
+import path from "path";
+import { describe, it } from "vitest";
+
+/**
+ * We should only have one snapshot file per test, this test ensures that
+ *
+ * If this test fails, you probably changed something in the request to an LLM.
+ * This causes MSW to generate a new snapshot (with a different hash).
+ * If that's intended, make sure to delete the old snapshot files.
+ */
+describe("MSW Snapshots", () => {
+ it("should only have one snapshot file per test", async () => {
+ const snapshotFiles = glob.sync(
+ path.join(__dirname, "../**/__msw_snapshots__/**/*.json")
+ );
+
+ // Group files by test name (excluding the sequence number and hash)
+ const testGroups: Record = {};
+
+ for (const file of snapshotFiles) {
+ // Extract the base name (removing the _1_, _2_ etc. and hash)
+ const match = file.match(/(.*)_\d+_[a-f0-9]+\.json$/);
+ if (match) {
+ const baseName = match[1];
+ if (!testGroups[baseName]) {
+ testGroups[baseName] = [];
+ }
+ testGroups[baseName].push(file);
+ } else {
+ throw new Error(`Invalid snapshot file: ${file}`);
+ }
+ }
+
+ // Filter and get tests with multiple snapshot files
+ const duplicates = Object.entries(testGroups)
+ .filter(([_, files]) => files.length > 1)
+ .map(([testName, files]) => ({
+ testName: path.basename(testName),
+ count: files.length,
+ files: files.map((file) => path.basename(file)),
+ }));
+
+ // Create error message if duplicates are found
+ const errorMessage =
+ duplicates.length > 0
+ ? [
+ `Found duplicate MSW snapshot files for the following (${duplicates.length}) tests:`,
+ ...duplicates.map(
+ ({ testName, count, files }) =>
+ ` - ${testName}: ${count} files\n ${files.join("\n ")}`
+ ),
+ "",
+ "Each test should have only one snapshot file.",
+ "Please clean up the duplicate snapshots by keeping only the most relevant one for each test.",
+ ].join("\n")
+ : "";
+
+ // Throw an error with the message if duplicates found
+ if (duplicates.length > 0) {
+ throw new Error(errorMessage);
+ }
+ });
+});
diff --git a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts
new file mode 100644
index 0000000000..376b324a11
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts
@@ -0,0 +1,168 @@
+import { BlockNoteEditor, PartialBlock } from "@blocknote/core";
+import { describe, expect, it } from "vitest";
+
+import { getCurrentTest } from "@vitest/runner";
+import path from "path";
+import { createAIExtension, getAIExtension } from "../../../AIExtension.js";
+import { testUpdateOperations } from "../../../testUtil/updates/updateOperations.js";
+import { CallLLMResult } from "../CallLLMResult.js";
+
+const BASE_FILE_PATH = path.resolve(__dirname, "__snapshots__");
+
+function createEditor(initialContent: PartialBlock[]) {
+ return BlockNoteEditor.create({
+ initialContent,
+ _extensions: {
+ ai: createAIExtension({
+ model: undefined as any,
+ }),
+ },
+ });
+}
+
+async function matchFileSnapshot(data: any, postFix = "") {
+ const t = getCurrentTest()!;
+ // this uses the same snapshot path, regardless of the model / streaming params
+ await expect(data).toMatchFileSnapshot(
+ path.resolve(
+ BASE_FILE_PATH,
+ t.suite!.name,
+ t.name + (postFix ? `_${postFix}` : "") + ".json"
+ )
+ );
+}
+
+export function generateSharedTestCases(
+ callLLM: (
+ editor: BlockNoteEditor,
+ params: { userPrompt: string }
+ ) => Promise,
+ skipTestsRequiringCapabilities?: {
+ mentions?: boolean;
+ textAlignment?: boolean;
+ }
+) {
+ describe("Update (formatting)", () => {
+ for (const test of testUpdateOperations) {
+ it(test.description, async (c) => {
+ if (
+ skipTestsRequiringCapabilities &&
+ Object.keys(test.requiredCapabilities || {}).some(
+ (c) =>
+ skipTestsRequiringCapabilities[
+ c as keyof typeof skipTestsRequiringCapabilities
+ ] === true
+ )
+ ) {
+ c.skip();
+ }
+
+ const editor = test.editor();
+ const result = await callLLM(editor, {
+ userPrompt: test.userPrompt,
+ });
+ await result.execute();
+
+ // the prosemirrorState has all details with suggested changes, so we use this for the snapshot
+ await matchFileSnapshot(editor.prosemirrorState.doc.toJSON());
+ // console.log(
+ // JSON.stringify(editor.prosemirrorState.doc.toJSON(), null, 2)
+ // );
+
+ // apply the update defined in the test to a new editor,
+ // and compare the result
+ const editorCompare = test.editor();
+ editorCompare.updateBlock(test.updateOp.id, test.updateOp.block);
+
+ // we first need to accept changes to get the correct result
+ getAIExtension(editor).acceptChanges();
+
+ expect(editor.document).toEqual(editorCompare.document);
+ });
+ }
+ });
+
+ describe("Delete", () => {
+ it("deletes a paragraph", async () => {
+ const editor = createEditor([
+ {
+ type: "paragraph",
+ content: "Hello",
+ },
+ {
+ type: "paragraph",
+ content: "World",
+ },
+ ]);
+ const result = await callLLM(editor, {
+ userPrompt: "delete the first sentence",
+ });
+
+ await result.execute();
+
+ // we first need to accept changes to get the correct result
+ getAIExtension(editor).acceptChanges();
+
+ await matchFileSnapshot(editor.document);
+ });
+ });
+
+ describe("Insert", () => {
+ it("inserts a paragraph at start", async () => {
+ const editor = createEditor([
+ {
+ type: "paragraph",
+ content: "Hello",
+ },
+ ]);
+ const result = await callLLM(editor, {
+ userPrompt: "Add a sentence with `Test` before the first sentence",
+ });
+
+ // for await (const op of result.llmResult.streamObjectResult?.fullStream) {
+ // console.log(op);
+ // // console.log(result.llmResult.streamObjectResult?.fullStream.locked);
+ // }
+
+ // for await (const op of result.llmResult.operationsSource) {
+ // console.log(op);
+ // // console.log(result.llmResult.streamObjectResult?.fullStream.locked);
+ // }
+
+ // for await (const op of result.llmResult.operationsSource) {
+ // console.log(op);
+ // // console.log(result.llmResult.streamObjectResult?.fullStream.locked);
+ // }
+
+ await result.execute();
+
+ // console.log(
+ // JSON.stringify(editor.prosemirrorState.doc.toJSON(), null, 2)
+ // );
+ // const co = await (result.llmResult as StreamObjectResult).;
+ // we first need to accept changes to get the correct result
+ getAIExtension(editor).acceptChanges();
+
+ await matchFileSnapshot(editor.document);
+ });
+
+ it("inserts a paragraph at end", async () => {
+ const editor = createEditor([
+ {
+ type: "paragraph",
+ content: "Hello",
+ },
+ ]);
+ const result = await callLLM(editor, {
+ userPrompt: `Add a paragraph with text "Test" after the first paragraph`,
+ });
+
+ await result.execute();
+
+ // we first need to accept changes to get the correct result
+ getAIExtension(editor).acceptChanges();
+
+ await matchFileSnapshot(editor.document);
+ });
+ });
+}
diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts
new file mode 100644
index 0000000000..64241965e2
--- /dev/null
+++ b/packages/xl-ai/src/api/index.ts
@@ -0,0 +1,30 @@
+import { CoreMessage } from "ai";
+import { callLLM as callLLMHTML } from "./formats/html-blocks/htmlBlocks.js";
+import { callLLM as callLLMJSON } from "./formats/json/json.js";
+import { callLLM as callLLMMarkdown } from "./formats/markdown-blocks/markdownBlocks.js";
+
+export const llm = {
+ json: {
+ call: callLLMJSON,
+ },
+ markdown: {
+ call: callLLMMarkdown,
+ },
+ html: {
+ call: callLLMHTML,
+ },
+};
+
+// TODO: good practice like this?
+export type PromptOrMessages =
+ | {
+
+ useSelection?: boolean;
+ userPrompt: string;
+ messages?: never;
+ }
+ | {
+ useSelection?: never;
+ userPrompt?: never;
+ messages: Array;
+ };
diff --git a/packages/xl-ai/src/api/prompts/htmlBlocksPrompt.ts b/packages/xl-ai/src/api/prompts/htmlBlocksPrompt.ts
new file mode 100644
index 0000000000..c77a1d9eaf
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/htmlBlocksPrompt.ts
@@ -0,0 +1,86 @@
+import { CoreMessage } from "ai";
+
+// TODO don't include child block
+export function promptManipulateSelectionHTMLBlocks(opts: {
+ userPrompt: string;
+ htmlSelectedBlocks: {
+ id: string;
+ block: string;
+ }[];
+ htmlDocument: {
+ block: string;
+ }[];
+}): Array {
+ return [
+ {
+ 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.
+ 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),
+ },
+ {
+ role: "system",
+ content: "The user asks you to do the following:",
+ },
+ {
+ role: "user",
+ content: opts.userPrompt,
+ },
+ ];
+}
+
+export function promptManipulateDocumentUseHTMLBlocks(opts: {
+ userPrompt: string;
+ htmlBlocks: Array<
+ | {
+ id: string;
+ block: string;
+ }
+ | {
+ cursor: true;
+ }
+ >;
+}): Array {
+ return [
+ {
+ role: "system",
+ content: `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 $).
+ This is the 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),
+ },
+ {
+ role: "system",
+ content: "The user asks you to do the following:",
+ },
+ {
+ 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).`,
+ },
+ ];
+}
diff --git a/packages/xl-ai/src/api/prompts/jsonSchemaPrompts copy.ts.bak b/packages/xl-ai/src/api/prompts/jsonSchemaPrompts copy.ts.bak
new file mode 100644
index 0000000000..b8b9919b7a
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/jsonSchemaPrompts copy.ts.bak
@@ -0,0 +1,99 @@
+import { BlockNoteEditor } from "@blocknote/core";
+import { CoreMessage } from "ai";
+import { suffixIDs } from "../util/suffixIDs.js";
+
+// TODO don't include child block
+export function promptManipulateSelectionJSONSchema(opts: {
+ editor: BlockNoteEditor;
+ userPrompt: string;
+ document: any;
+}): Array {
+ if (!opts.editor.getSelection()) {
+ throw new Error("No selection");
+ }
+ return [
+ {
+ role: "system",
+ content: `You're manipulating a text document. Make sure to follow the json schema provided.
+ The user selected everything between [$! and !$], including blocks in between.`,
+ },
+ {
+ role: "system",
+ content: JSON.stringify(suffixIDs(opts.document)),
+ },
+ {
+ role: "system",
+ content:
+ "Make sure to ONLY affect the selected text and blocks (split words if necessary), and don't include the markers in the response.",
+ },
+ {
+ role: "user",
+ content: opts.userPrompt,
+ },
+ ];
+}
+
+export function promptManipulateDocumentUseJSONSchema(opts: {
+ editor: BlockNoteEditor;
+ userPrompt: string;
+ document: any;
+}): Array {
+ return [
+ {
+ role: "system",
+ content:
+ "You're helping the user redact / write a rich text document (in JSON format).",
+ },
+ {
+ role: "system",
+ content: "This is what the user wants you to do:",
+ },
+ {
+ role: "user",
+ content: opts.userPrompt,
+ },
+ {
+ role: "system",
+ content: "This is the document the user wants to update:",
+ },
+ {
+ role: "system",
+ content: JSON.stringify(suffixIDs(opts.document)),
+ },
+ {
+ role: "system",
+ content:
+ "Use the JSON schema provided. For reference, here's an example of how the block format works: \n" +
+ JSON.stringify({
+ type: "paragraph",
+ props: {},
+ content: [
+ {
+ styles: {},
+ type: "text",
+ text: "A sentence with regular text.",
+ },
+ {
+ styles: {
+ bold: true,
+ },
+ type: "text",
+ text: "Bold text",
+ },
+ {
+ styles: {
+ italic: true,
+ },
+ type: "text",
+ text: " and italic text",
+ },
+ ],
+ }),
+ },
+ {
+ role: "system",
+ content: `First, decide if the user wants you to add / remove / update blocks, or a combination.
+ When updating an existing block, make sure to take the existing text (block content) and update it, don't just add text at the end of the block unless the user asks for it.`,
+ },
+ ];
+}
diff --git a/packages/xl-ai/src/api/prompts/jsonSchemaPrompts.ts b/packages/xl-ai/src/api/prompts/jsonSchemaPrompts.ts
new file mode 100644
index 0000000000..c177594778
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/jsonSchemaPrompts.ts
@@ -0,0 +1,78 @@
+import { CoreMessage } from "ai";
+
+// TODO don't include child block
+export function promptManipulateSelectionJSONBlocks(opts: {
+ userPrompt: string;
+ jsonSelectedBlocks: any[];
+ jsonDocument: any[];
+}): 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),
+ },
+
+ {
+ 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:",
+ },
+ {
+ role: "user",
+ content: opts.userPrompt,
+ },
+ ];
+}
+
+export function promptManipulateDocumentUseJSONBlocks(opts: {
+ userPrompt: string;
+ jsonBlocks: Array<
+ | any
+ | {
+ cursor: true;
+ }
+ >;
+}): 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),
+ },
+ {
+ role: "system",
+ content: "The user asks you to do the following:",
+ },
+ {
+ 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).`,
+ },
+ ];
+}
diff --git a/packages/xl-ai/src/api/prompts/markdownBlocksPrompt.ts b/packages/xl-ai/src/api/prompts/markdownBlocksPrompt.ts
new file mode 100644
index 0000000000..61cc3e781a
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/markdownBlocksPrompt.ts
@@ -0,0 +1,86 @@
+import { CoreMessage } from "ai";
+
+// TODO don't include child block
+export 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),
+ },
+
+ {
+ 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:",
+ },
+ {
+ role: "user",
+ content: opts.userPrompt,
+ },
+ ];
+}
+
+export function promptManipulateDocumentUseMarkdownBlocks(opts: {
+ userPrompt: string;
+ markdownBlocks: Array<
+ | {
+ id: string;
+ block: string;
+ }
+ | {
+ cursor: true;
+ }
+ >;
+}): Array {
+ return [
+ {
+ role: "system",
+ content: `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:",
+ },
+ {
+ 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).`,
+ },
+ ];
+}
diff --git a/packages/xl-ai/src/api/prompts/markdownPrompts.ts b/packages/xl-ai/src/api/prompts/markdownPrompts.ts
new file mode 100644
index 0000000000..198eebf500
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/markdownPrompts.ts
@@ -0,0 +1,60 @@
+import { BlockNoteEditor } from "@blocknote/core";
+import { CoreMessage } from "ai";
+
+export function promptManipulateDocumentUseMarkdown(opts: {
+ editor: BlockNoteEditor;
+ userPrompt: string;
+ markdown: string;
+}): Array {
+ return [
+ {
+ role: "system",
+ content:
+ "You're helping the user redact / write a markdown document split in blocks.",
+ },
+ {
+ role: "system",
+ content: "This is what the user wants you to do:",
+ },
+ {
+ role: "user",
+ content: opts.userPrompt,
+ },
+ {
+ role: "system",
+ content: "This is the document the user wants to update:",
+ },
+ {
+ role: "system",
+ content: opts.markdown,
+ },
+ ];
+}
+
+export function promptManipulateDocumentUseMarkdownWithSelection(opts: {
+ editor: BlockNoteEditor;
+ userPrompt: string;
+ markdown: string;
+}): Array {
+ return [
+ {
+ role: "system",
+ content:
+ "You're manipulating a markdown document. The user selected everything between [$! and !$], including blocks in between. Don't include any other text, comments or wrapping marks. Next message is the existing document in markdown:",
+ },
+ {
+ role: "user",
+ content: opts.markdown,
+ },
+ {
+ role: "system",
+ content: `You MUST return the ENTIRE markdown document (from start to end, INCLUDING parts outside the selection).
+ But, the next user prompt ONLY applies to the selectiom so make sure to ONLY change the selected text (text between [$! and !$]) and keep the rest of the document unchanged.
+ DO NOT include the markers in the response.`,
+ },
+ {
+ role: "user",
+ content: opts.userPrompt,
+ },
+ ];
+}
diff --git a/packages/xl-ai/src/api/prompts/promptHelpers/addCursorPosition.ts b/packages/xl-ai/src/api/prompts/promptHelpers/addCursorPosition.ts
new file mode 100644
index 0000000000..8d357dd620
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/promptHelpers/addCursorPosition.ts
@@ -0,0 +1,34 @@
+import { BlockNoteEditor } from "@blocknote/core";
+
+type BlocksWithCursor = {
+ id: string;
+ block: T;
+} | {
+ cursor: true;
+}
+
+export function addCursorPosition(editor: BlockNoteEditor, source: Array<{
+ id: string;
+ block: T;
+}>): Array>
+{
+ const cursorPosition = editor.getTextCursorPosition();
+ const ret: Array> = [];
+
+ for (const block of source) {
+ const isBlockWithCursor = block.id === cursorPosition.block.id;
+
+ ret.push({
+ id: block.id,
+ block: block.block,
+ });
+
+ if (isBlockWithCursor) {
+ ret.push({
+ cursor: true,
+ });
+ }
+ }
+
+ return ret;
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/prompts/promptHelpers/convertBlocks.ts b/packages/xl-ai/src/api/prompts/promptHelpers/convertBlocks.ts
new file mode 100644
index 0000000000..a8ff6953fb
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/promptHelpers/convertBlocks.ts
@@ -0,0 +1,13 @@
+import { Block } from "@blocknote/core";
+
+export async function convertBlocks(source: Block[], mapFn: (block: Block) => Promise): Promise> {
+ return await Promise.all(source.map(async (block) => {
+ return {
+ id: block.id,
+ block: await mapFn(block),
+ };
+ }));
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/prompts/promptHelpers/index.ts b/packages/xl-ai/src/api/prompts/promptHelpers/index.ts
new file mode 100644
index 0000000000..2222315be6
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/promptHelpers/index.ts
@@ -0,0 +1,29 @@
+import { Block } from "@blocknote/core";
+import { trimArray } from "../../util/trimArray.js";
+
+function isEmptyParagraph(block: Block) {
+ return (
+ block.type === "paragraph" &&
+ Array.isArray(block.content) &&
+ block.content.length === 0
+ );
+ }
+
+export function trimEmptyBlocks(source: Block[], opts?: {
+ trimStart?: boolean;
+ trimEnd?: boolean;
+}) {
+ // trim empty trailing blocks that don't have the cursor
+ // if we don't do this, commands like "add some paragraphs"
+ // would add paragraphs after the trailing blocks
+ const trimmedSource = trimArray(
+ source,
+ (block) => {
+ return isEmptyParagraph(block)
+ },
+ opts?.trimStart,
+ opts?.trimEnd
+ );
+
+ return trimmedSource;
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/prompts/promptHelpers/suffixIds.ts b/packages/xl-ai/src/api/prompts/promptHelpers/suffixIds.ts
new file mode 100644
index 0000000000..2878d95a5f
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/promptHelpers/suffixIds.ts
@@ -0,0 +1,12 @@
+
+export function suffixIDs(source: Array): Array {
+ return source.map((el) => {
+ if (typeof el === 'object' && el && 'id' in el) {
+ return {
+ ...el,
+ id: `${el.id}$`,
+ };
+ }
+ return el;
+ });
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/prompts/promptHelpers/trimEmptyBlocks.ts b/packages/xl-ai/src/api/prompts/promptHelpers/trimEmptyBlocks.ts
new file mode 100644
index 0000000000..0f514f7c09
--- /dev/null
+++ b/packages/xl-ai/src/api/prompts/promptHelpers/trimEmptyBlocks.ts
@@ -0,0 +1,23 @@
+import { Block } from "@blocknote/core";
+import { isEmptyParagraph } from "../../util/emptyBlock.js";
+import { trimArray } from "../../util/trimArray.js";
+
+
+export function trimEmptyBlocks(source: Block[], opts?: {
+ trimStart?: boolean;
+ trimEnd?: boolean;
+}) {
+ // trim empty trailing blocks that don't have the cursor
+ // if we don't do this, commands like "add some paragraphs"
+ // would add paragraphs after the trailing blocks
+ const trimmedSource = trimArray(
+ source,
+ (block) => {
+ return isEmptyParagraph(block)
+ },
+ opts?.trimStart ?? false,
+ opts?.trimEnd ?? true
+ );
+
+ return trimmedSource;
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/schema/mergeSchema.ts b/packages/xl-ai/src/api/schema/mergeSchema.ts
new file mode 100644
index 0000000000..dca14e5203
--- /dev/null
+++ b/packages/xl-ai/src/api/schema/mergeSchema.ts
@@ -0,0 +1,121 @@
+import type { SimpleJSONObjectSchema } from "../util/JSONSchema.js";
+
+/**
+ * Merges schemas that only differ by the "type" field.
+ * @param schemas The array of schema objects to be processed.
+ * @returns A new array with merged schema objects where applicable.
+ */
+export function mergeSchemas(
+ schemas: SimpleJSONObjectSchema[]
+): SimpleJSONObjectSchema[] {
+ const groupedSchemas: { [signature: string]: string[] } = {};
+ const signatureToSchema: { [signature: string]: SimpleJSONObjectSchema } = {};
+
+ schemas.forEach((schemaObj) => {
+ // Extract the schema properties except for the "type" field
+ const { type, ...rest } = schemaObj.properties;
+ const schemaSignature = JSON.stringify(rest); // Generate a signature for comparison
+
+ // If the signature already exists, add the "type" to the enum
+ if (groupedSchemas[schemaSignature]) {
+ groupedSchemas[schemaSignature].push(type.enum[0]);
+ } else {
+ // Create a new group if it doesn't exist
+ groupedSchemas[schemaSignature] = [type.enum[0]];
+ signatureToSchema[schemaSignature] = schemaObj;
+ }
+ });
+
+ // Create the new merged schema array
+ const mergedSchemas: SimpleJSONObjectSchema[] = Object.keys(
+ groupedSchemas
+ ).map((signature) => {
+ const baseSchema = signatureToSchema[signature];
+ return {
+ ...baseSchema,
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: "string",
+ enum: groupedSchemas[signature],
+ },
+ },
+ };
+ });
+
+ return mergedSchemas;
+}
+
+// // Example usage:
+// const exampleSchemas: Schema[] = [
+// {
+// type: "object",
+// properties: {
+// type: { type: "string", enum: ["paragraph"] },
+// content: { $ref: "#/$defs/inlinecontent" },
+// props: {
+// type: "object",
+// properties: {
+// backgroundColor: { type: "string" },
+// textColor: { type: "string" },
+// textAlignment: {
+// type: "string",
+// enum: ["left", "center", "right", "justify"],
+// },
+// },
+// additionalProperties: false,
+// },
+// },
+// additionalProperties: false,
+// required: ["type"],
+// },
+// {
+// type: "object",
+// properties: {
+// type: { type: "string", enum: ["bulletListItem"] },
+// content: { $ref: "#/$defs/inlinecontent" },
+// props: {
+// type: "object",
+// properties: {
+// backgroundColor: { type: "string" },
+// textColor: { type: "string" },
+// textAlignment: {
+// type: "string",
+// enum: ["left", "center", "right", "justify"],
+// },
+// },
+// additionalProperties: false,
+// },
+// },
+// additionalProperties: false,
+// required: ["type"],
+// },
+// {
+// type: "object",
+// properties: {
+// type: { type: "string", enum: ["heading"] },
+// content: { $ref: "#/$defs/inlinecontent" },
+// props: {
+// type: "object",
+// properties: {
+// backgroundColor: { type: "string" },
+// textColor: { type: "string" },
+// textAlignment: {
+// type: "string",
+// enum: ["left", "center", "right", "justify"],
+// },
+// level: {
+// type: "number",
+// enum: [1, 2, 3],
+// },
+// },
+// additionalProperties: false,
+// },
+// },
+// additionalProperties: false,
+// required: ["type"],
+// },
+// ];
+
+// const mergedSchemas = mergeSchemas(exampleSchemas);
+// console.log(JSON.stringify(mergedSchemas, null, 2));
diff --git a/packages/xl-ai/src/api/schema/schemaToJSONSchema.test.ts b/packages/xl-ai/src/api/schema/schemaToJSONSchema.test.ts
new file mode 100644
index 0000000000..8fbdc02402
--- /dev/null
+++ b/packages/xl-ai/src/api/schema/schemaToJSONSchema.test.ts
@@ -0,0 +1,43 @@
+import { afterEach, beforeEach, describe, it } from "vitest";
+
+import { BlockNoteEditor } from "@blocknote/core";
+
+import { defaultSchemaTestCases } from "../../testUtil/cases/defaultSchema.js";
+import { blockNoteSchemaToJSONSchema } from "./schemaToJSONSchema.js";
+
+const testCases = [defaultSchemaTestCases];
+
+describe("Test BlockNote-Prosemirror conversion", () => {
+ for (const testCase of testCases) {
+ describe("Case: " + testCase.name, () => {
+ let editor: BlockNoteEditor;
+ const div = document.createElement("div");
+
+ beforeEach(() => {
+ editor = testCase.createEditor();
+ // Note that we don't necessarily need to mount a root
+ // Currently, we do mount to a root so that it reflects the "production" use-case more closely.
+
+ // However, it would be nice to increased converage and share the same set of tests for these cases:
+ // - does render to a root
+ // - does not render to a root
+ // - runs in server (jsdom) environment using server-util
+ editor.mount(div);
+ });
+
+ afterEach(() => {
+ editor.mount(undefined);
+ editor._tiptapEditor.destroy();
+ editor = undefined as any;
+
+ delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
+ });
+
+ it.only("creates json schema", async () => {
+ // eslint-disable-next-line no-console
+ console.log(JSON.stringify(blockNoteSchemaToJSONSchema(editor.schema)));
+ // }
+ });
+ });
+ }
+});
diff --git a/packages/xl-ai/src/api/schema/schemaToJSONSchema.ts b/packages/xl-ai/src/api/schema/schemaToJSONSchema.ts
new file mode 100644
index 0000000000..470c127c87
--- /dev/null
+++ b/packages/xl-ai/src/api/schema/schemaToJSONSchema.ts
@@ -0,0 +1,324 @@
+import {
+ BlockNoteSchema,
+ BlockSchema,
+ InlineContentSchema,
+ PropSchema,
+ StyleSchema,
+ defaultProps,
+} from "@blocknote/core";
+import { SimpleJSONObjectSchema } from "../util/JSONSchema.js";
+import { mergeSchemas } from "./mergeSchema.js";
+/*
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "format": "uuid"
+ },
+ "type": {
+ "type": "string",
+ "enum": ["paragraph", "heading"]
+ },
+ "props": {
+ "type": "object",
+ "properties": {
+ "textColor": {
+ "type": "string",
+ "enum": ["default"]
+ },
+ "backgroundColor": {
+ "type": "string",
+ "enum": ["default"]
+ },
+ "textAlignment": {
+ "type": "string",
+ "enum": ["left"]
+ },
+ "level": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 6
+ }
+ },
+ "required": ["textColor", "backgroundColor", "textAlignment"],
+ "additionalProperties": false
+ },
+ "content": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": ["text"]
+ },
+ "text": {
+ "type": "string"
+ },
+ "styles": {
+ "type": "object",
+ "properties": {
+ "bold": {
+ "type": "boolean"
+ },
+ "italic": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "required": ["type", "text"],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": ["id", "type", "props", "content"],
+ "additionalProperties": false
+ }
+ }*/
+
+export function styleSchemaToJSONSchema(
+ schema: StyleSchema
+): SimpleJSONObjectSchema {
+ return {
+ type: "object",
+ properties: Object.fromEntries(
+ Object.entries(schema).map(([key, val]) => {
+ return [
+ key,
+ {
+ type: val.propSchema,
+ },
+ ];
+ })
+ ),
+ additionalProperties: false,
+ };
+}
+
+export function styledTextToJSONSchema() {
+ return {
+ type: "object",
+ properties: {
+ type: {
+ type: "string",
+ enum: ["text"],
+ },
+ text: {
+ type: "string",
+ },
+ styles: {
+ $ref: "#/$defs/styles",
+ },
+ },
+ additionalProperties: false,
+ required: ["type", "text"],
+ };
+}
+
+export function propSchemaToJSONSchema(
+ propSchema: PropSchema
+): SimpleJSONObjectSchema {
+ return {
+ type: "object",
+ properties: Object.fromEntries(
+ Object.entries(propSchema)
+ .filter(([_key, val]) => {
+ // for now skip optional props
+ return val.default !== undefined;
+ //&& key !== "language";
+ })
+ .map(([key, val]) => {
+ return [
+ key,
+ {
+ type: typeof val.default,
+ enum: val.values,
+ },
+ ];
+ })
+ ),
+ additionalProperties: false,
+ };
+}
+
+export function inlineContentSchemaToJSONSchema(schema: InlineContentSchema) {
+ return {
+ type: "array",
+ items: {
+ anyOf: Object.entries(schema).map(([_key, val]) => {
+ if (val === "text") {
+ return {
+ $ref: "#/$defs/styledtext",
+ };
+ }
+ if (val === "link") {
+ return {
+ type: "object",
+ properties: {
+ type: {
+ type: "string",
+ enum: ["link"],
+ },
+ content: {
+ type: "array",
+ items: {
+ $ref: "#/$defs/styledtext",
+ },
+ },
+ href: {
+ type: "string",
+ },
+ },
+ additionalProperties: false,
+ required: ["type", "href", "content"],
+ };
+ }
+ return {
+ type: "object",
+ properties: {
+ type: {
+ type: "string",
+ enum: [val.type],
+ },
+ content:
+ val.content === "styled"
+ ? {
+ type: "array",
+ items: {
+ $ref: "#/$defs/styledtext",
+ },
+ }
+ : undefined,
+ props: propSchemaToJSONSchema(val.propSchema),
+ },
+ additionalProperties: false,
+ required: ["type", ...(val.content === "styled" ? ["content"] : [])],
+ };
+ }),
+ },
+ };
+}
+
+export function blockSchemaToJSONSchema(schema: BlockSchema) {
+ return {
+ anyOf: mergeSchemas(
+ Object.entries(schema).map(([_key, val]) => {
+ return {
+ type: "object",
+ properties: {
+ type: {
+ type: "string",
+ enum: [val.type],
+ },
+ content:
+ val.content === "inline"
+ ? { $ref: "#/$defs/inlinecontent" }
+ : val.content === "table"
+ ? { type: "object", properties: {} } // TODO
+ : undefined,
+ // filter out default props (TODO: make option)
+ props: propSchemaToJSONSchema(val.propSchema),
+ // Object.fromEntries(
+ // Object.entries(val.propSchema).filter(
+ // (key) => typeof (defaultProps as any)[key[0]] === "undefined"
+ // )
+ // )
+ // ),
+ },
+ additionalProperties: false,
+ required: ["type"], //, ...(val.content === "inline" ? ["content"] : [])],
+ };
+ })
+ ),
+ };
+}
+
+export function blockNoteSchemaToJSONSchema(
+ schema: Pick<
+ BlockNoteSchema,
+ "blockSchema" | "inlineContentSchema" | "styleSchema"
+ >
+) {
+ schema = schemaOps(schema).removeFileBlocks().removeDefaultProps().get();
+ return {
+ $defs: {
+ styles: styleSchemaToJSONSchema(schema.styleSchema),
+ styledtext: styledTextToJSONSchema(),
+ inlinecontent: inlineContentSchemaToJSONSchema(
+ schema.inlineContentSchema
+ ),
+ block: blockSchemaToJSONSchema(schema.blockSchema),
+ },
+ };
+}
+
+// export function markdownToJSONSchema(
+// schema: Pick<
+// BlockNoteSchema,
+// "blockSchema" | "inlineContentSchema" | "styleSchema"
+// >
+// ) {
+// schema = schemaOps(schema).removeFileBlocks().removeDefaultProps().get();
+// return {
+// $defs: {
+// block: {
+// type: "string",
+// },
+// },
+// };
+// }
+
+type Writeable = { -readonly [P in keyof T]: T[P] };
+
+export function schemaOps(
+ schema: Pick<
+ BlockNoteSchema,
+ "blockSchema" | "inlineContentSchema" | "styleSchema"
+ >
+) {
+ const clone: Writeable = JSON.parse(
+ JSON.stringify({
+ blockSchema: schema.blockSchema,
+ inlineContentSchema: schema.inlineContentSchema,
+ styleSchema: schema.styleSchema,
+ })
+ );
+ return {
+ removeFileBlocks() {
+ clone.blockSchema = Object.fromEntries(
+ Object.entries(clone.blockSchema).filter(
+ ([_key, val]) => !val.isFileBlock
+ )
+ );
+ return this;
+ },
+ removeDefaultProps() {
+ clone.blockSchema = Object.fromEntries(
+ Object.entries(clone.blockSchema).map(([key, val]) => {
+ return [
+ key,
+ {
+ ...val,
+ propSchema: Object.fromEntries(
+ Object.entries(val.propSchema).filter(
+ (key) => typeof (defaultProps as any)[key[0]] === "undefined"
+ )
+ ) as any,
+ },
+ ];
+ })
+ );
+ return this;
+ },
+
+ get() {
+ return clone;
+ },
+ };
+}
diff --git a/packages/xl-ai/src/api/streamTool/asTool.test.ts b/packages/xl-ai/src/api/streamTool/asTool.test.ts
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/packages/xl-ai/src/api/streamTool/asTool.ts b/packages/xl-ai/src/api/streamTool/asTool.ts
new file mode 100644
index 0000000000..7783b62cca
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/asTool.ts
@@ -0,0 +1,42 @@
+import { jsonSchema, tool } from "ai";
+import { operationsToStream } from "./callLLMWithStreamTools.js";
+import { createStreamToolsArraySchema } from "./jsonSchema.js";
+import { StreamTool } from "./streamTool.js";
+
+export function streamToolAsTool>(streamTool: T) {
+ return tool({
+ parameters: jsonSchema(streamTool.parameters, {
+ validate: (value) => {
+ const result = streamTool.validate(value);
+ if (result.result === "invalid") {
+ return { success: false, error: new Error(result.reason) };
+ }
+ 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.result === "invalid") {
+ return { success: false, error: new Error(stream.reason) };
+ }
+ return { success: true, value: stream.value };
+ }
+ }),
+ execute: async (value) => {
+ // TODO
+ console.log("execute", value)
+ }
+ })
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/streamTool/callLLMWithStreamTools.ts b/packages/xl-ai/src/api/streamTool/callLLMWithStreamTools.ts
new file mode 100644
index 0000000000..e502f71c17
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/callLLMWithStreamTools.ts
@@ -0,0 +1,273 @@
+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 { InvalidOrOk, StreamTool, StreamToolCall } from "./streamTool.js";
+
+type LLMRequestOptionsInternal = {
+ model: LanguageModel;
+ messages: CoreMessage[];
+ maxRetries: number;
+};
+
+type Optional = Omit & Partial>;
+
+export type LLMRequestOptions = Optional<
+ LLMRequestOptionsInternal,
+ "maxRetries"
+>;
+
+/**
+ * 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<{
+ operation: StreamToolCall;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+ }>;
+};
+
+export async function generateOperations[]>(
+ streamTools: T,
+ opts: LLMRequestOptions & {
+ _generateObjectOptions?: Partial>[0]>;
+ }
+): Promise> {
+ const { _generateObjectOptions, ...rest } = opts;
+
+ if (
+ _generateObjectOptions &&
+ ("output" in _generateObjectOptions ||
+ "schema" in _generateObjectOptions ||
+ "mode" in _generateObjectOptions)
+ ) {
+ throw new Error(
+ "Cannot provide output or schema in _generateObjectOptions"
+ );
+ }
+
+ const schema = jsonSchema(createStreamToolsArraySchema(streamTools));
+
+ const options = {
+ // non-overridable options for streamObject
+ mode: "tool" as const,
+ output: "object" as const,
+ schema,
+
+ // configurable options for streamObject
+
+ // - optional, with defaults
+ maxRetries: 2,
+ // - mandatory ones:
+ ...rest,
+
+ // extra options for streamObject
+ ...((_generateObjectOptions ?? {}) as any),
+ };
+
+ const ret = await generateObject<{ operations: any }>(options);
+
+ const stream = operationsToStream(ret.object);
+
+ if (stream.result === "invalid") {
+ throw new Error(stream.reason);
+ }
+
+ let _operationsSource: OperationsResult["operationsSource"];
+
+ return {
+ streamObjectResult: undefined,
+ generateObjectResult: ret,
+ get operationsSource() {
+ if (!_operationsSource) {
+ _operationsSource = createAsyncIterableStreamFromAsyncIterable(
+ preprocessOperationsNonStreaming(stream.value, streamTools)
+ );
+ }
+ return _operationsSource;
+ },
+ };
+}
+
+export function operationsToStream[]>(
+ object: unknown
+): InvalidOrOk<
+ AsyncIterable<{
+ partialOperation: StreamToolCall;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+ }>
+> {
+ if (
+ !object ||
+ typeof object !== "object" ||
+ !("operations" in object) ||
+ !Array.isArray(object.operations)
+ ) {
+ return {
+ result: "invalid",
+ reason: "No operations returned",
+ };
+ }
+ const operations = object.operations;
+ async function* singleChunkGenerator() {
+ for (const op of operations) {
+ // TODO: non-streaming might not need some steps
+ // in the executor
+ yield {
+ partialOperation: op,
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+ }
+ }
+
+ return {
+ result: "ok",
+ value: singleChunkGenerator(),
+ };
+}
+
+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 ||
+ "mode" in _streamObjectOptions)
+ ) {
+ throw new Error("Cannot provide output or schema in _streamObjectOptions");
+ }
+
+ const schema = jsonSchema(createStreamToolsArraySchema(streamTools));
+
+ const options = {
+ // non-overridable options for streamObject
+ mode: "tool" as const,
+ output: "object" as const,
+ schema,
+
+ // configurable options for streamObject
+
+ // - optional, with defaults
+ maxRetries: 2,
+ // - mandatory ones:
+ ...rest,
+
+ // extra options for streamObject
+ ...((opts._streamObjectOptions ?? {}) as any),
+ };
+
+ const ret = streamObject<{ operations: any }>(options);
+
+ let _operationsSource: OperationsResult["operationsSource"];
+
+ return {
+ streamObjectResult: ret,
+ generateObjectResult: undefined,
+ get operationsSource() {
+ if (!_operationsSource) {
+ _operationsSource = createAsyncIterableStreamFromAsyncIterable(
+ preprocessOperationsStreaming(
+ filterNewOrUpdatedOperations(
+ streamOnStartCallback(
+ partialObjectStreamThrowError(ret.fullStream),
+ onStart
+ )
+ ),
+ streamTools
+ )
+ );
+ }
+ return _operationsSource;
+ },
+ };
+}
+
+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
+function partialObjectStreamThrowError(
+ stream: AsyncIterableStream>
+): 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":
+ throw chunk.error;
+ default: {
+ const _exhaustiveCheck: never = chunk;
+ throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`);
+ }
+ }
+ },
+ })
+ )
+ );
+}
diff --git a/packages/xl-ai/src/api/streamTool/filterNewOrUpdatedOperations.test.ts b/packages/xl-ai/src/api/streamTool/filterNewOrUpdatedOperations.test.ts
new file mode 100644
index 0000000000..c68e9bdc7f
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/filterNewOrUpdatedOperations.test.ts
@@ -0,0 +1,158 @@
+import { describe, expect, it } from "vitest";
+import { filterNewOrUpdatedOperations } from "./filterNewOrUpdatedOperations.js";
+
+describe("filterNewOrUpdatedOperations", () => {
+ it("should filter out new operations from a stream", async () => {
+ // Create a mock stream
+ async function* mockStream() {
+ yield {
+ operations: [
+ { id: 1, content: "op1" },
+ { id: 2, content: "op2-partial" },
+ ],
+ };
+ yield {
+ operations: [
+ { id: 1, content: "op1" },
+ { id: 2, content: "op2-complete" },
+ { id: 3, content: "op3" },
+ ],
+ };
+ }
+
+ const result = [];
+ for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
+ result.push(chunk);
+ }
+
+ expect(result.length).toBe(5);
+
+ // First chunk should have op1 and op2-partial
+ expect(result[0]).toEqual({
+ partialOperation: { id: 1, content: "op1" },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ });
+
+ expect(result[1]).toEqual({
+ partialOperation: { id: 2, content: "op2-partial" },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: true,
+ });
+
+ expect(result[2]).toEqual({
+ partialOperation: { id: 2, content: "op2-complete" },
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: false,
+ });
+
+ expect(result[3]).toEqual({
+ partialOperation: { id: 3, content: "op3" },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: true,
+ });
+
+ expect(result[4]).toEqual({
+ partialOperation: { id: 3, content: "op3" },
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: false,
+ });
+ });
+
+ it("should filter out new operations from a stream (partial start)", async () => {
+ // Create a mock stream
+ async function* mockStream() {
+ yield {
+ operations: [{ id: 1, content: "op1-partial" }],
+ };
+ yield {
+ operations: [
+ { id: 1, content: "op1-complete" },
+ { id: 2, content: "op2" },
+ ],
+ };
+ }
+
+ const result = [];
+ for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
+ result.push(chunk);
+ }
+
+ expect(result.length).toBe(4);
+
+ // First chunk should have op1-partial
+ expect(result[0]).toEqual({
+ partialOperation: { id: 1, content: "op1-partial" },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: true,
+ });
+
+ // Second chunk should have op1-complete
+ expect(result[1]).toEqual({
+ partialOperation: { id: 1, content: "op1-complete" },
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: false,
+ });
+
+ // Third chunk should have op2
+ expect(result[2]).toEqual({
+ partialOperation: { id: 2, content: "op2" },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: true,
+ });
+
+ expect(result[3]).toEqual({
+ partialOperation: { id: 2, content: "op2" },
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: false,
+ });
+ });
+
+ it("should handle empty operations array", async () => {
+ async function* mockStream() {
+ yield { operations: [] };
+ yield { operations: [{ id: 1, content: "op1" }] };
+ }
+
+ const result = [];
+ for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
+ result.push(chunk);
+ }
+
+ expect(result.length).toBe(2);
+ expect(result[0]).toEqual({
+ partialOperation: { id: 1, content: "op1" },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: true,
+ });
+ expect(result[1]).toEqual({
+ partialOperation: { id: 1, content: "op1" },
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: false,
+ });
+ });
+
+ it("should handle undefined operations", async () => {
+ async function* mockStream() {
+ yield {};
+ yield { operations: [{ id: 1, content: "op1" }] };
+ }
+
+ const result = [];
+ for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
+ result.push(chunk);
+ }
+
+ expect(result.length).toBe(2);
+ expect(result[0]).toEqual({
+ partialOperation: { id: 1, content: "op1" },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: true,
+ });
+ expect(result[1]).toEqual({
+ partialOperation: { id: 1, content: "op1" },
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: false,
+ });
+ });
+});
diff --git a/packages/xl-ai/src/api/streamTool/filterNewOrUpdatedOperations.ts b/packages/xl-ai/src/api/streamTool/filterNewOrUpdatedOperations.ts
new file mode 100644
index 0000000000..6f1d17611d
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/filterNewOrUpdatedOperations.ts
@@ -0,0 +1,64 @@
+/**
+ * This takes the partialObjectStream from an LLM streaming response.
+ *
+ * Note that this streams in multiple operations in the operations array, and this will be called with chunks like this:
+ *
+ * {operations: [op1, op2partial]}
+ * {operations: [op1, op2complete, op3, op4]}
+ *
+ * This function transforms it into a stream of new or updated operations, so the output would be like this:
+ *
+ * {newOrUpdatedOperations: [op1, op2partial]}
+ * {newOrUpdatedOperations: [op2complete, op3, op4]}
+ */
+export async function* filterNewOrUpdatedOperations(
+ partialObjectStream: AsyncIterable<{
+ operations?: any[];
+ }>
+): AsyncGenerator<{
+ partialOperation: any;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+}> {
+ let numOperationsAppliedCompletely = 0;
+ let first = true;
+
+ let lastOp: any;
+
+ for await (const chunk of partialObjectStream) {
+ if (!chunk.operations?.length) {
+ // yield { newOrUpdatedOperations: [] };
+ continue;
+ }
+
+ for (
+ let i = numOperationsAppliedCompletely;
+ i < chunk.operations.length;
+ i++
+ ) {
+ const operation = chunk.operations[i];
+ lastOp = operation;
+ yield {
+ partialOperation: operation,
+ isUpdateToPreviousOperation:
+ i === numOperationsAppliedCompletely && !first,
+ isPossiblyPartial: i === chunk.operations.length - 1,
+ };
+ first = false;
+ }
+
+ // Update count to exclude the last operation which might be incomplete
+ numOperationsAppliedCompletely = chunk.operations.length - 1;
+ }
+
+ if (!lastOp) {
+ throw new Error("No operations seen");
+ }
+
+ // mark final operation as final (by emitting with isPossiblyPartial: false)
+ yield {
+ partialOperation: lastOp,
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: false,
+ };
+}
diff --git a/packages/xl-ai/src/api/streamTool/filterValidOperations.test.ts b/packages/xl-ai/src/api/streamTool/filterValidOperations.test.ts
new file mode 100644
index 0000000000..b8042a35de
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/filterValidOperations.test.ts
@@ -0,0 +1,103 @@
+import { describe, expect, it } from "vitest";
+import { AddBlocksToolCall } from "../tools/createAddBlocksTool.js";
+import { UpdateBlockToolCall } from "../tools/createUpdateBlockTool.js";
+import { filterValidOperations } from "./filterValidOperations.js";
+import { InvalidOrOk } from "./streamTool.js";
+
+describe("filterValidOperations", () => {
+ it("should filter out valid operations from a stream", async () => {
+ // Create a mock stream with valid and invalid operations
+ async function* mockStream() {
+ yield {
+ operation: {
+ result: "ok",
+ value: {
+ type: "add",
+ blocks: [],
+ referenceId: "123",
+ position: "after",
+ } as AddBlocksToolCall,
+ } as InvalidOrOk | UpdateBlockToolCall>,
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+
+ yield {
+ operation: {
+ result: "invalid",
+ reason: "Invalid operation",
+ } as InvalidOrOk | UpdateBlockToolCall>,
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+
+ yield {
+ operation: {
+ result: "ok",
+ value: {
+ type: "update",
+ id: "456",
+ block: { content: "updated" },
+ } as UpdateBlockToolCall,
+ } as InvalidOrOk | UpdateBlockToolCall>,
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: true,
+ };
+ }
+
+ const result = [];
+ for await (const chunk of filterValidOperations(mockStream())) {
+ result.push(chunk);
+ }
+
+ // Should only have the valid operations
+ expect(result.length).toBe(2);
+
+ expect(result[0]).toEqual({
+ operation: {
+ type: "add",
+ blocks: [],
+ referenceId: "123",
+ position: "after",
+ },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ });
+
+ expect(result[1]).toEqual({
+ operation: { type: "update", id: "456", block: { content: "updated" } },
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: true,
+ });
+ });
+
+ it("should handle a stream with only invalid operations", async () => {
+ async function* mockStream() {
+ yield {
+ operation: {
+ result: "invalid",
+ reason: "Invalid operation 1",
+ } as InvalidOrOk | UpdateBlockToolCall>,
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+
+ yield {
+ operation: {
+ result: "invalid",
+ reason: "Invalid operation 2",
+ } as InvalidOrOk | UpdateBlockToolCall>,
+ isUpdateToPreviousOperation: true,
+ isPossiblyPartial: false,
+ };
+ }
+
+ const result = [];
+ for await (const chunk of filterValidOperations(mockStream())) {
+ result.push(chunk);
+ }
+
+ // Should have no valid operations
+ expect(result.length).toBe(0);
+ });
+});
diff --git a/packages/xl-ai/src/api/streamTool/filterValidOperations.ts b/packages/xl-ai/src/api/streamTool/filterValidOperations.ts
new file mode 100644
index 0000000000..a1292b329c
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/filterValidOperations.ts
@@ -0,0 +1,33 @@
+import { InvalidOrOk } from "./streamTool.js";
+
+/**
+ * Filters out invalid operations from the stream.
+ */
+export async function* filterValidOperations(
+ operationsStream: AsyncIterable<{
+ operation: InvalidOrOk;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+ }>,
+ onInvalidOperation?: (
+ operation: InvalidOrOk & {
+ result: "invalid";
+ }
+ ) => void
+): AsyncGenerator<{
+ operation: T;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+}> {
+ for await (const chunk of operationsStream) {
+ if (chunk.operation.result === "ok") {
+ yield {
+ operation: chunk.operation.value,
+ isUpdateToPreviousOperation: chunk.isUpdateToPreviousOperation,
+ isPossiblyPartial: chunk.isPossiblyPartial,
+ };
+ } else {
+ onInvalidOperation?.(chunk.operation);
+ }
+ }
+}
diff --git a/packages/xl-ai/src/api/streamTool/jsonSchema.ts b/packages/xl-ai/src/api/streamTool/jsonSchema.ts
new file mode 100644
index 0000000000..7384fc085f
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/jsonSchema.ts
@@ -0,0 +1,57 @@
+import { JSONSchema7Definition } from "json-schema";
+import isEqual from "lodash.isequal";
+import { SimpleJSONObjectSchema } from "../util/JSONSchema.js";
+import { StreamTool } from "./streamTool.js";
+
+export function streamToolToJSONSchema(tool: StreamTool) {
+ // this adds the tool name as the "type". (not very clean way to do it)
+ const { properties, required, $defs, ...rest } = tool.parameters;
+ return {
+ schema: {
+ type: "object",
+ description: tool.description,
+ properties: {
+ type: {
+ type: "string",
+ enum: [tool.name],
+ },
+ ...properties,
+ },
+ required: ["type", ...(required ?? [])],
+ additionalProperties: false,
+ ...rest,
+ },
+ $defs,
+ };
+}
+
+export function createStreamToolsArraySchema(
+ streamTools: StreamTool[]
+): SimpleJSONObjectSchema & { $defs?: Record } {
+ const schemas = streamTools.map((tool) => streamToolToJSONSchema(tool));
+
+ const $defs: Record = {};
+ for (const schema of schemas) {
+ for (const key in schema.$defs) {
+ if ($defs[key] && !isEqual($defs[key], schema.$defs[key])) {
+ throw new Error(`Duplicate, but different definition for ${key}`);
+ }
+ $defs[key] = schema.$defs[key];
+ }
+ }
+
+ return {
+ type: "object",
+ properties: {
+ operations: {
+ type: "array",
+ items: {
+ anyOf: schemas.map((schema) => schema.schema),
+ },
+ },
+ },
+ additionalProperties: false,
+ required: ["operations"] as string[],
+ $defs: Object.keys($defs).length > 0 ? $defs : undefined,
+ };
+}
diff --git a/packages/xl-ai/src/api/streamTool/preprocess.test.ts b/packages/xl-ai/src/api/streamTool/preprocess.test.ts
new file mode 100644
index 0000000000..737923d7bd
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/preprocess.test.ts
@@ -0,0 +1,228 @@
+import { BlockNoteEditor } from "@blocknote/core";
+import { beforeEach, describe, expect, it } from "vitest";
+
+import { applyOperations } from "../executor/streamOperations/applyOperations.js";
+
+import {
+ getApplySuggestionsTr,
+ rebaseTool,
+} from "../../prosemirror/rebaseTool.js";
+import { tools } from "../formats/json/tools/index.js";
+import { preprocessOperationsStreaming } from "./preprocess.js";
+import { StreamTool } from "./streamTool.js";
+
+type StreamType = AsyncIterable<{
+ partialOperation: any;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+}>;
+
+
+
+// TODO: maybe change unit test or move to json test, because this does not only test preprocess
+// but also applyOperations
+async function* executeOperations(
+ editor: BlockNoteEditor,
+ operationsStream: StreamType,
+ streamTools: StreamTool[]
+) {
+
+ const preprocessedOperationsStream = preprocessOperationsStreaming(
+ operationsStream,
+ streamTools
+ );
+
+ yield* applyOperations(
+ editor,
+ preprocessedOperationsStream,
+ async () => rebaseTool(editor, getApplySuggestionsTr(editor)),
+ { withDelays: false }
+ );
+}
+
+describe("executeOperations", () => {
+ let editor: BlockNoteEditor;
+ let streamTools: StreamTool[];
+ beforeEach(() => {
+ editor = BlockNoteEditor.create({
+ initialContent: [
+ {
+ type: "paragraph",
+ content: "test",
+ id: "existing-id",
+ },
+ ],
+ });
+ streamTools = [
+ tools.add(editor, { idsSuffixed: true }),
+ tools.update(editor, { idsSuffixed: true }),
+ tools.delete(editor, { idsSuffixed: true }),
+ ];
+ });
+
+ it("should process insert operations", async () => {
+ async function* mockStream(): StreamType {
+ yield {
+ partialOperation: {
+ type: "add" as const,
+ referenceId: "existing-id$",
+ position: "after" as const,
+ blocks: [
+ {
+ type: "paragraph" as const,
+ content: [{ type: "text" as const, text: "test" }],
+ },
+ ],
+ },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+ }
+
+ const results: any[] = [];
+ for await (const result of executeOperations(
+ editor,
+ mockStream(),
+ streamTools
+ )) {
+ results.push(result);
+ }
+
+ expect(results.length).toBe(1);
+ expect(results[0].result).toBe("ok");
+ expect(editor.document.length).toBe(2);
+ expect(editor.document[1]).toMatchObject({
+ type: "paragraph",
+ content: [{ type: "text", text: "test" }],
+ });
+ });
+
+ it("should handle multiple operations in sequence", async () => {
+ const op1 = {
+ type: "add" as const,
+ position: "after" as const,
+ referenceId: "existing-id$",
+ blocks: [
+ {
+ type: "paragraph" as const,
+ content: [{ type: "text" as const, text: "first" }],
+ },
+ ],
+ };
+ async function* mockStream(): StreamType {
+ yield {
+ partialOperation: op1,
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+ yield {
+ partialOperation: {
+ type: "add" as const,
+ position: "after" as const,
+ referenceId: "existing-id$",
+ blocks: [
+ {
+ type: "paragraph" as const,
+ content: [{ type: "text" as const, text: "second" }],
+ },
+ ],
+ },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+ }
+
+ const results: any[] = [];
+ for await (const result of executeOperations(
+ editor,
+ mockStream(),
+ streamTools
+ )) {
+ results.push(result);
+ }
+
+ expect(results.length).toBe(2);
+ expect(editor.document.length).toBe(3);
+ expect(editor.document[1]).toMatchObject({
+ type: "paragraph",
+ content: [{ type: "text", text: "second" }],
+ });
+ expect(editor.document[2]).toMatchObject({
+ type: "paragraph",
+ content: [{ type: "text", text: "first" }],
+ });
+ });
+
+ it("should handle empty operation streams", async () => {
+ async function* mockStream(): StreamType {
+ // Empty stream
+ }
+
+ const results: any[] = [];
+ for await (const result of executeOperations(
+ editor,
+ mockStream(),
+ streamTools
+ )) {
+ results.push(result);
+ }
+
+ expect(results).toHaveLength(0);
+ expect(editor.document.length).toBe(1);
+ });
+
+ it("should handle invalid operations", async () => {
+ async function* mockStream(): StreamType {
+ yield {
+ partialOperation: {
+ type: "invalid",
+ },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+ }
+
+ const results: any[] = [];
+ for await (const result of executeOperations(
+ editor,
+ mockStream(),
+ streamTools
+ )) {
+ results.push(result);
+ }
+
+ expect(results.length).toBe(0);
+ });
+
+ it("should handle update operations", async () => {
+ async function* mockStream(): StreamType {
+ yield {
+ partialOperation: {
+ type: "update" as const,
+ id: "existing-id$",
+ block: {
+ content: [{ type: "text", text: "updated" }],
+ },
+ },
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ };
+ }
+
+ const results: any[] = [];
+ for await (const result of executeOperations(
+ editor,
+ mockStream(),
+ streamTools
+ )) {
+ results.push(result);
+ }
+
+ expect(results.length).toBe(1);
+ expect(results[0].result).toBe("ok");
+ expect(editor.document[0]).toMatchObject({
+ type: "paragraph",
+ content: [{ type: "text", text: "updated" }],
+ });
+ });
+});
diff --git a/packages/xl-ai/src/api/streamTool/preprocess.ts b/packages/xl-ai/src/api/streamTool/preprocess.ts
new file mode 100644
index 0000000000..c9704ef9c6
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/preprocess.ts
@@ -0,0 +1,64 @@
+
+import {
+ filterValidOperations,
+ toValidatedOperations,
+} from "../executor/streamOperations/index.js";
+import { StreamTool, StreamToolCall } from "./streamTool.js";
+
+export type PreprocessOperationResult[]> = {
+ operation: StreamToolCall;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+};
+
+export async function* preprocessOperationsStreaming<
+ T extends StreamTool[]
+>(
+ operationsStream: AsyncIterable<{
+ partialOperation: any;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+ }>,
+ streamTools: T
+): AsyncGenerator> {
+ // from partial operations to valid / invalid operations
+ const validatedOperationsStream = toValidatedOperations(
+ operationsStream,
+ streamTools
+ );
+
+ // filter valid operations, invalid operations are ignored
+ const validOperationsStream = filterValidOperations(
+ validatedOperationsStream
+ );
+
+ yield* validOperationsStream;
+}
+
+export async function* preprocessOperationsNonStreaming<
+ T extends StreamTool[]
+>(
+ operationsStream: AsyncIterable<{
+ partialOperation: any;
+ isUpdateToPreviousOperation: boolean;
+ isPossiblyPartial: boolean;
+ }>,
+ streamTools: T
+): AsyncGenerator> {
+ // from partial operations to valid / invalid operations
+ const validatedOperationsStream = toValidatedOperations(
+ operationsStream,
+ streamTools
+ );
+
+ // filter valid operations, invalid operations should throw an error
+ const validOperationsStream = filterValidOperations(
+ validatedOperationsStream,
+ (operation) => {
+ throw new Error("invalid operation: " + operation.reason);
+ }
+ );
+
+ // yield results
+ yield* validOperationsStream;
+}
diff --git a/packages/xl-ai/src/api/streamTool/streamTool.ts b/packages/xl-ai/src/api/streamTool/streamTool.ts
new file mode 100644
index 0000000000..41ae0a2547
--- /dev/null
+++ b/packages/xl-ai/src/api/streamTool/streamTool.ts
@@ -0,0 +1,320 @@
+import { DeepPartial } from "ai";
+import { JSONSchema7 } from "json-schema";
+
+export type InvalidOrOk =
+ | {
+ result: "invalid";
+ reason: string;
+ }
+ | { result: "ok"; value: T };
+
+/**
+ * A StreamTool is a function that can be called by the LLM.
+ * It's similar to a Tool in the Vercel AI SDK, but:
+ *
+ * - a collection of StreamTools can be wrapped in a single LLM Tool to issue multiple operations (tool calls) at once.
+ * - StreamTools can be used in a streaming manner.
+ */
+export type StreamTool